Exemplo n.º 1
0
        /*
         * private static int nextloadID = 0;
         * private int loadID;
         */

        //constructs a Vessel_Structure
        public Vessel_Structure(Zone_Shipyard shipyard)
        {
            /*
             * loadID = nextloadID;
             * nextloadID++;
             */
            map = shipyard.Map;
            ResetGrids();
            int     avgDenom     = 0;
            IntVec3 avgNumerator = IntVec3.Zero;

            foreach (IntVec3 cell in shipyard.cells)
            {
                if (map.terrainGrid.TerrainAt(cell).defName.StartsWith("Boat_"))
                {
                    if (map.terrainGrid.TerrainAt(cell) != null)
                    {
                        SetTerrain(cell, map.terrainGrid.TerrainAt(cell));
                        map.terrainGrid.RemoveTopLayer(cell, false);
                        FilthMaker.RemoveAllFilth(cell, map);
                        avgNumerator += cell;
                        avgDenom++;
                    }

                    /*
                     * if (map.terrainGrid.UnderTerrainAt(cell) != null)
                     * {
                     *  SetUnderTerrain(cell, map.terrainGrid.UnderTerrainAt(cell));
                     *  avgNumerator += cell;
                     *  avgDenom++;
                     * }
                     */
                    List <Thing> thingList = map.thingGrid.ThingsListAtFast(cell);
                    for (int i = thingList.Count - 1; i >= 0; i--)
                    {
                        RegisterInCell(thingList[i], cell);
                        thingList[i].DeSpawn();

                        avgNumerator += cell;
                        avgDenom++;
                    }
                    cells.Add(cell);
                }
            }
            Center = new IntVec3(avgNumerator.x / avgDenom, avgNumerator.y / avgDenom, avgNumerator.z / avgDenom);
        }
Exemplo n.º 2
0
 public static void ActivateVesselForming(LordJob_FormAndSendCaravan job)
 {
     ActiveJob      = job;
     activeshipyard = GetShipyardToEmbark(job);
 }
Exemplo n.º 3
0
 public static void DeactivateVesselForming(LordJob_FormAndSendCaravan job)
 {
     RemoveVesselEmbark(job);
     ActiveJob      = null;
     activeshipyard = null;
 }
Exemplo n.º 4
0
 public static void AddVesselEmbark(LordJob_FormAndSendCaravan job, Zone_Shipyard shipyard)
 {
     SendVesselJobs.Add(job);
     ShipyardsToSend.Add(shipyard);
 }