namespace uniflash {

    export abstract class Context {

        static $inject = ['ufSession', '$stateParams']
        constructor(
            private ufSession: uniflash.session.SessionService,
            private $stateParams: any
        ) { }

        getCurrentCore(): uniflash.target_config.Core {
            let cores = this.ufSession.queryConfig().cores;
            let coreName = this.$stateParams.coreName;
            let core = _.find(cores,{name : coreName}) || cores[0];
            return core;
        }

    }

    angular.module('uniflash').service('ufContext', Context);
}