Exemplo n.º 1
0
        public void Init()
        {
            _game = new TestGame();
            StaticDataManager.LoadData("Pulsar4x", _game.Game);  // TODO: Figure out correct directory
            _entityManager = _game.Game.GlobalManager;



            // Initialize gas dictionary - haven't found a good way to look up gases without doing this
            _gasDictionary = new Dictionary <string, AtmosphericGasSD>();

            foreach (WeightedValue <AtmosphericGasSD> atmos in _game.Game.StaticData.AtmosphericGases)
            {
                _gasDictionary.Add(atmos.Value.ChemicalSymbol, atmos.Value);
            }


            _planetsList = new List <Entity>();
            _planetsList.Add(_game.Earth);

            _speciesList = new List <Entity>();
            _speciesList.Add(_game.HumanSpecies);
            //_speciesList.Add(_game.GreyAlienSpecies);

            // Set up colonies
            // @todo: add more colonies, especially ones with multiple species in one colony


            ComponentTemplateSD infrastructureSD     = _game.Game.StaticData.ComponentTemplates[new Guid("08b3e64c-912a-4cd0-90b0-6d0f1014e9bb")];
            ComponentDesign     infrastructureDesign = GenericComponentFactory.StaticToDesign(infrastructureSD, _game.HumanFaction.GetDataBlob <FactionTechDB>(), _game.Game.StaticData);
            Entity infrastructureEntity = GenericComponentFactory.DesignToDesignEntity(_game.Game, _game.HumanFaction, infrastructureDesign);

            EntityManipulation.AddComponentToEntity(_game.EarthColony, infrastructureEntity);

            ReCalcProcessor.ReCalcAbilities(_game.EarthColony);
        }