Пример #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();
        }
Пример #2
0
 /// <summary>
 ///     Initialise the game engine.
 /// </summary>
 private void Init()
 {
     theUserInputPlayer            = new UserInputPlayer();
     ObjectGame.TheUserInputPlayer = theUserInputPlayer;
     theTickEngine = new TickEngineThread();
     theTickEngine.Setup("GameEngine", GameTick, StatusTick, timerTickIntervalMs);
     watch = Stopwatch.StartNew();
     watch.Stop();
 }