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(); }
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; }
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; }
public ActorTextOutput(ITextOutputViewModel textOutputVm) { _textOutputVm = textOutputVm; Receive <String>(msg => writeText(msg)); }
public ActorTextOutput(ITextOutputViewModel textOutputVm) { _textOutputVm = textOutputVm; Receive<String>(msg => writeText(msg)); }