# HG changeset patch # User Alys Brooks # Date 2021-12-18 08:36:24 # Node ID 0ed293fcfe093a7b386a2bcfe119b162533c535b # Parent 363413cebbb6bb02be2f20da6604c144ca552c67 Add tree count. 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 @@ -199,6 +199,13 @@ } } + public int dead_trees + { + get { + return this.map.iterate_cells().Where(c => (c.status == CellStatus.DeadTree)).Count(); + } + } + public float healthy_percent { get { diff --git a/isometric-park-fna/UI/ForestWindow.cs b/isometric-park-fna/UI/ForestWindow.cs --- a/isometric-park-fna/UI/ForestWindow.cs +++ b/isometric-park-fna/UI/ForestWindow.cs @@ -95,7 +95,8 @@ ImGui.Separator(); - ImGui.Text(string.Format("Crowded Trees: {0}", sim.crowded_trees )); + ImGui.Text(string.Format("Crowded Trees: {0}", sim.crowded_trees)); + ImGui.Text(string.Format("Dead Trees: {0}", sim.dead_trees)); ImGui.Text(string.Format("Percent Healthy Trees: {0:F2}", sim.healthy_percent)); ImGui.Text(string.Format("Average Age of Trees: {0:F2}", sim.average_tree_age)); ImGui.Text(string.Format("Max Age of Trees: {0:F2}", sim.max_tree_age));