Esempio n. 1
0
 public void Demolish()
 {
     for (int i = 0; i < foundations.Length; i++)
     {
         foundations[i].FlattenTo(height);
         foundations[i].BuildingOnSquare = null;
         GroundMaterial tempPass = foundations[i].Tile;
         GroundMaterial.SetToMud(foundations[i], ref tempPass);
     }
     Destroy(this);
 }
Esempio n. 2
0
 public void ChangeVertexElevation(GridDirection vertex, int value)
 {
     if (value == 0 && ((HasRoadThroughEdge(vertex.Next()) && (GetElevationDifference(vertex.Next()) > 3 || HasCliff(vertex.Next()))) ||
                        (HasRoadThroughEdge(vertex.Previous()) && (GetElevationDifference(vertex.Previous()) > 3 || HasCliff(vertex.Previous())))
                        ))
     {
         Debug.Log("Could not change elevation");
     }
     else
     {
         vertexElevations[vertex] += value;
         GroundMaterial.SetToMud(this, ref tile);
     }
 }
Esempio n. 3
0
    bool[] roads = new bool[8]; // includes diagonals


    public void Demolish()
    {
        urbanLevel    = 0;
        plantLevel    = 0;
        farmLevel     = 0;
        scenaryObject = 0;
        industry      = 0;
        if (buildingOnSquare != null)
        {
            buildingOnSquare.Demolish();
        }
        GroundMaterial.SetToMud(this, ref tile);
        Explosion();
    }
Esempio n. 4
0
    public void RemoveIncomingRivers()
    {
        if (!hasIncomingRivers.Any())
        {
            return;
        }
        GridDirection[] neighbors = IncomingRivers;
        for (int i = 0; i < hasIncomingRivers.Length; i++)
        {
            hasIncomingRivers[i] = false;
        }
        GroundMaterial.SetToMud(this, ref tile);
        RefreshChunkOnly();

        foreach (GridDirection direction in neighbors)
        {
            SquareCell neighbor = GetNeighbor(direction);
            hasOutgoingRivers[(int)direction.Opposite()] = false;
            neighbor.RefreshChunkOnly();
        }
    }
Esempio n. 5
0
 void SetRoad(int direction, bool state)
 {
     roads[direction] = state;
     GroundMaterial.SetToMud(this, ref tile);
     Refresh();
 }