diff --git a/isometric-park-fna/CellMap.cs b/isometric-park-fna/CellMap.cs --- a/isometric-park-fna/CellMap.cs +++ b/isometric-park-fna/CellMap.cs @@ -184,27 +184,40 @@ } + public enum CellStatus{ + Clear, + LivingTree, + DeadTree + } + public class Cell { - public Boolean _hasTree = false; + // public Boolean _hasTree = false; + public CellStatus status { + get; + private set; + } public Boolean hasTree { get { - return _hasTree; + return this.status == CellStatus.LivingTree; } } public DateTime planted; public void addTree(DateTime datetime) { - this._hasTree = true; + this.status = CellStatus.LivingTree; this.planted = datetime; + } - } public void removeTree() { - this._hasTree = false; + this.status = CellStatus.Clear; + } + public void markTreeDead() { + this.status = CellStatus.DeadTree; } } } diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -707,15 +707,21 @@ if (this.simulation.map.cells[i][j].hasTree) { //until we actually simulate: - if ((i + j) % 8 == 0) - { + drawTileAt(i, j, 142, 2); + // if ((i + j) % 8 == 0) + // { + // drawTileAt(i, j, 141, 2); + // } + // else + // { + // drawTileAt(i, j, 142, 2); + // } + } + else if (this.simulation.map.cells[i][j].status == CellStatus.DeadTree) { drawTileAt(i, j, 141, 2); - } - else - { - drawTileAt(i, j, 142, 2); - } - } + // System.Console.WriteLine(String.Format("Drew Dead Tree at {0},{1}", i, j)); + + } } } #endregion draw_trees diff --git a/isometric-park-fna/Simulation.cs b/isometric-park-fna/Simulation.cs --- a/isometric-park-fna/Simulation.cs +++ b/isometric-park-fna/Simulation.cs @@ -239,7 +239,7 @@ { if (random.NextDouble() > NEIGHBOR_CROWDS_TREE_CHANCE) { - cell.removeTree(); + cell.markTreeDead(); crowded_out += 1; } }