Esempio n. 1
0
        // Token: 0x06000035 RID: 53 RVA: 0x00003914 File Offset: 0x00001B14
        public bool tryGenSatellite()
        {
            int     num = Find.World.grid.TilesCount - this.numberOfSatellites - 1;
            Vector3 getOrbitVectorBase  = this.satDef.getOrbitVectorBase;
            Vector3 getOrbitVectorRange = this.satDef.getOrbitVectorRange;
            bool    result;

            try
            {
                WorldObjectChild_Satellite worldObjectChild_Satellite = (WorldObjectChild_Satellite)WorldObjectMaker.MakeWorldObject(DefDatabase <WorldObjectDef> .GetNamed(this.satDef.WorldObjectDefNames.RandomElement <string>(), true));
                worldObjectChild_Satellite.Tile   = num;
                worldObjectChild_Satellite.period = (float)((int)this.randomOrbit(this.satDef.getOrbitPeriod, this.satDef.getOrbitPeriodVar));
                Find.WorldObjects.Add(worldObjectChild_Satellite);
                this.numberOfSatellites++;
                this.satelliteTiles.Add(num);
                this.satellites.Add(worldObjectChild_Satellite);
                this.applySatelliteSurface(num);
                this.satelliteTilesReal.Add(this.getTile(num));
                result = true;
            }
            catch
            {
                //Log.Error("Failed to add satellite", false);
                result = false;
            }
            return(result);
        }
Esempio n. 2
0
 // Token: 0x06000007 RID: 7 RVA: 0x00002348 File Offset: 0x00000548
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.Look <float>(ref this.period, "period", 0f, false);
     Scribe_Values.Look <int>(ref this.timeOffset, "timeOffset", 0, false);
     Scribe_Values.Look <Vector3>(ref this.maxOrbits, "maxOrbits", default(Vector3), false);
     Scribe_Values.Look <Vector3>(ref this.shiftOrbits, "shiftOrbits", default(Vector3), false);
     WorldObjectChild_Satellite.GetInstanceField(typeof(WorldObject), this, "BaseDrawSize");
 }
Esempio n. 3
0
        // Token: 0x06000037 RID: 55 RVA: 0x00003A7C File Offset: 0x00001C7C
        public bool tryGenSatellite(int tile, Vector3 Periapsis, Vector3 Apoapsis, int period)
        {
            bool result;

            try
            {
                WorldObjectChild_Satellite worldObjectChild_Satellite = (WorldObjectChild_Satellite)WorldObjectMaker.MakeWorldObject(DefDatabase <WorldObjectDef> .GetNamed(this.defs.RandomElement <string>(), true));
                worldObjectChild_Satellite.Tile   = tile;
                worldObjectChild_Satellite.period = (float)period;
                Find.WorldObjects.Add(worldObjectChild_Satellite);
                result = true;
            }
            catch
            {
                //Log.Error("Failed to add satellite", false);
                result = false;
            }
            return(result);
        }