コード例 #1
0
            public void Serialize(DataSerializer s)
            {
                EnhancedForestFire d = Singleton <EnhancedDisastersManager> .instance.container.ForestFire;

                serializeCommonParameters(s, d);
                s.WriteInt32(d.WarmupDays);
                s.WriteFloat(d.noRainDays);
            }
コード例 #2
0
        public override void CopySettings(EnhancedDisaster disaster)
        {
            base.CopySettings(disaster);

            EnhancedForestFire d = disaster as EnhancedForestFire;

            if (d != null)
            {
                WarmupDays = d.WarmupDays;
            }
        }
コード例 #3
0
            public void Deserialize(DataSerializer s)
            {
                EnhancedForestFire d = Singleton <EnhancedDisastersManager> .instance.container.ForestFire;

                deserializeCommonParameters(s, d);
                d.WarmupDays = s.ReadInt32();
                if (s.version <= 2)
                {
                    float daysPerFrame = Helper.DaysPerFrame;
                    d.noRainDays = s.ReadInt32() * daysPerFrame;
                }
                else
                {
                    d.noRainDays = s.ReadFloat();
                }
            }
コード例 #4
0
        public void CheckObjects()
        {
            if (ForestFire == null)
            {
                ForestFire = new EnhancedForestFire();
            }
            if (Thunderstorm == null)
            {
                Thunderstorm = new EnhancedThunderstorm();
            }
            if (Sinkhole == null)
            {
                Sinkhole = new EnhancedSinkhole();
            }
            if (Tsunami == null)
            {
                Tsunami = new EnhancedTsunami();
            }
            if (Tornado == null)
            {
                Tornado = new EnhancedTornado();
            }
            if (Earthquake == null)
            {
                Earthquake = new EnhancedEarthquake();
            }
            if (MeteorStrike == null)
            {
                MeteorStrike = new EnhancedMeteorStrike();
            }

            AllDisasters.Clear();
            AllDisasters.Add(ForestFire);
            AllDisasters.Add(Thunderstorm);
            AllDisasters.Add(Sinkhole);
            AllDisasters.Add(Tsunami);
            AllDisasters.Add(Tornado);
            AllDisasters.Add(Earthquake);
            AllDisasters.Add(MeteorStrike);
        }