Example #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();
        }
Example #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;
        }
Example #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;
        }
Example #4
0
        public ActorTextOutput(ITextOutputViewModel textOutputVm)
        {
            _textOutputVm = textOutputVm;

            Receive <String>(msg => writeText(msg));
        }
Example #5
0
        public ActorTextOutput(ITextOutputViewModel textOutputVm)
        {
            _textOutputVm = textOutputVm;

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