Esempio n. 1
0
        public MainGalaxyViewModel(IGalaxyPopulator initGalaxyCreator,
                                   IGalaxyViewModelFactory initGalaxyViewModelFactory,
                                   ISolarSystemViewModelFactory initSolarSystemViewModelFactory,
                                   IPlanetViewModelFactory initPlanetViewModelFactory,
                                   ITextOutputViewModel initTextOutputViewModel,
                                   ITickEngine initTickEngine)
        {
            _galaxyCreator = initGalaxyCreator;
            _tickEngine    = initTickEngine;

            _galaxyViewModelFactory      = initGalaxyViewModelFactory;
            _solarSystemViewModelFactory = initSolarSystemViewModelFactory;
            _planetViewModelFactory      = initPlanetViewModelFactory;

            TextOutput = initTextOutputViewModel;

            StarChart.InitialiseStarChart();
            ResourceTypes.InitialiseResourceTypes();
            BluePrints.InitialiseBluePrints();

            loadOrCreateGalaxy();
            initialiseEngine();

            saveGalaxy();
        }
Esempio n. 2
0
        public void SetupTickEngine(IGalaxyViewModel state, ITextOutputViewModel textOutput)
        {
            _galaxyActorSystem = ActorSystem.Create("GalaxyActors");

            Props textOutputProps = Props.Create<ActorTextOutput>(textOutput).WithDispatcher("akka.actor.synchronized-dispatcher");
            _actorTextOutput = _galaxyActorSystem.ActorOf(textOutputProps, "TextOutput");

            Props teCoordinatorProps = Props.Create<ActorTickEngineCoordinator>(_actorTextOutput, state.Model);
            _actorTECoordinator = _galaxyActorSystem.ActorOf(teCoordinatorProps, "TECoordinator");

            engineInitialised = true;
        }
Esempio n. 3
0
        public void SetupTickEngine(IGalaxyViewModel state, ITextOutputViewModel textOutput)
        {
            _galaxyActorSystem = ActorSystem.Create("GalaxyActors");

            Props textOutputProps = Props.Create <ActorTextOutput>(textOutput).WithDispatcher("akka.actor.synchronized-dispatcher");

            _actorTextOutput = _galaxyActorSystem.ActorOf(textOutputProps, "TextOutput");

            Props teCoordinatorProps = Props.Create <ActorTickEngineCoordinator>(_actorTextOutput, state.Model);

            _actorTECoordinator = _galaxyActorSystem.ActorOf(teCoordinatorProps, "TECoordinator");

            engineInitialised = true;
        }
Esempio n. 4
0
        public ActorTextOutput(ITextOutputViewModel textOutputVm)
        {
            _textOutputVm = textOutputVm;

            Receive <String>(msg => writeText(msg));
        }
Esempio n. 5
0
        public ActorTextOutput(ITextOutputViewModel textOutputVm)
        {
            _textOutputVm = textOutputVm;

            Receive<String>(msg => writeText(msg));
        }