コード例 #1
0
        public SystemBody(OrbitingEntity parent, PlanetType type)
            : base()
        {
            /// <summary>
            /// create these or else anything that relies on a unique global id will break.
            /// </summary>
            Id = Guid.NewGuid();

            Type = type; // set the type ASAP in case anthing needs to know it.

            Moons       = new BindingList <SystemBody>();
            Populations = new BindingList <Population>();

            SSEntity = StarSystemEntityType.Body;

            Parent   = parent;
            Position = parent.Position;

            TaskGroupsInOrbit = new BindingList <TaskGroupTN>();

            GeoSurveyList = new Dictionary <Faction, bool>();

            /// <summary>
            /// Default mineral amount is zero.
            /// do mineral generation elsewhere.
            /// </summary>
            m_aiMinerialReserves      = new float[Constants.Minerals.NO_OF_MINERIALS];
            m_aiMinerialAccessibility = new float[Constants.Minerals.NO_OF_MINERIALS];
            for (int mineralIterator = 0; mineralIterator < (int)Constants.Minerals.MinerialNames.MinerialCount; mineralIterator++)
            {
                m_aiMinerialReserves[mineralIterator]      = 0.0f;
                m_aiMinerialAccessibility[mineralIterator] = 0.0f;
            }
            _MineralsGenerated = false;
            _BodyMineralType   = MineralType.NotGenerated;

#warning planet generation needs minerals, anomalies, and ruins generation.
            PlanetaryRuins = new Ruins();


            Atmosphere = new Atmosphere(this);

            if (Type != PlanetType.GasDwarf && Type != PlanetType.GasGiant && Type != PlanetType.IceGiant)
            {
                SupportsPopulations = true;
            }
        }
コード例 #2
0
ファイル: SystemBody.cs プロジェクト: EterniaLogic/Pulsar4x
        public SystemBody(OrbitingEntity parent, PlanetType type)
            : base()
        {
            /// <summary>
            /// create these or else anything that relies on a unique global id will break.
            /// </summary>
            Id = Guid.NewGuid();

            Type = type; // set the type ASAP in case anthing needs to know it.

            Moons = new BindingList<SystemBody>();
            Populations = new BindingList<Population>();

            SSEntity = StarSystemEntityType.Body;

            Parent = parent;
            Position = parent.Position;

            TaskGroupsInOrbit = new BindingList<TaskGroupTN>();

            GeoSurveyList = new Dictionary<Faction, bool>();

            /// <summary>
            /// Default mineral amount is zero.
            /// do mineral generation elsewhere.
            /// </summary>
            m_aiMinerialReserves = new float[Constants.Minerals.NO_OF_MINERIALS];
            m_aiMinerialAccessibility = new float[Constants.Minerals.NO_OF_MINERIALS];
            for (int mineralIterator = 0; mineralIterator < (int)Constants.Minerals.MinerialNames.MinerialCount; mineralIterator++)
            {
                m_aiMinerialReserves[mineralIterator] = 0.0f;
                m_aiMinerialAccessibility[mineralIterator] = 0.0f;
            }

#warning planet generation needs minerals, anomalies, and ruins generation.
            PlanetaryRuins = new Ruins();


            Atmosphere = new Atmosphere(this);
        }