예제 #1
0
파일: River.cs 프로젝트: cfdj/EcoRestoria
 //Should this change the tile being displayed to a river?
 //Yes for clarity in other places
 public void AddSegment(TileDisplay newSeg)
 {
     Segments.Add(newSeg);
     newSeg.setRiver();
     if (newSeg.GetHeight() < lowestHeight)
     {
         lowestHeight = newSeg.GetHeight();
         foreach (TileDisplay t in Segments)
         {
             t.setHeight(lowestHeight);
         }
     }
 }
예제 #2
0
파일: HexGrid.cs 프로젝트: cfdj/EcoRestoria
    //hills currently look too spikey, so moving their neighbours to be a similar height
    void hillSmooth(TileDisplay hill)
    {
        List <TileDisplay> neighbours = new List <TileDisplay>(hill.GetNeightbours());

        foreach (TileDisplay t in neighbours)
        {
            if (t != null)
            {
                if (t.GetHeight() < hill.GetHeight())
                {
                    t.setHeight(hill.GetHeight() - 1);
                }
            }
        }
    }