Description:
Add tree states.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -184,27 +184,40 | |||
|
184 | 184 | |
|
185 | 185 | } |
|
186 | 186 | |
|
187 | public enum CellStatus{ | |
|
188 | Clear, | |
|
189 | LivingTree, | |
|
190 | DeadTree | |
|
191 | } | |
|
192 | ||
|
187 | 193 | public class Cell |
|
188 | 194 | { |
|
189 | public Boolean _hasTree = false; | |
|
195 | // public Boolean _hasTree = false; | |
|
196 | public CellStatus status { | |
|
197 | get; | |
|
198 | private set; | |
|
199 | } | |
|
190 | 200 | |
|
191 | 201 | public Boolean hasTree { |
|
192 | 202 | get { |
|
193 |
return |
|
|
203 | return this.status == CellStatus.LivingTree; | |
|
194 | 204 | } |
|
195 | 205 | } |
|
196 | 206 | |
|
197 | 207 | public DateTime planted; |
|
198 | 208 | |
|
199 | 209 | public void addTree(DateTime datetime) { |
|
200 |
this. |
|
|
210 | this.status = CellStatus.LivingTree; | |
|
201 | 211 | |
|
202 | 212 | this.planted = datetime; |
|
213 | } | |
|
203 | 214 | |
|
204 | } | |
|
205 | 215 | public void removeTree() { |
|
206 |
this. |
|
|
216 | this.status = CellStatus.Clear; | |
|
217 | } | |
|
207 | 218 | |
|
219 | public void markTreeDead() { | |
|
220 | this.status = CellStatus.DeadTree; | |
|
208 | 221 | } |
|
209 | 222 | } |
|
210 | 223 | } |
@@ -707,15 +707,21 | |||
|
707 | 707 | |
|
708 | 708 | if (this.simulation.map.cells[i][j].hasTree) |
|
709 | 709 | { //until we actually simulate: |
|
710 | if ((i + j) % 8 == 0) | |
|
711 |
|
|
|
710 | drawTileAt(i, j, 142, 2); | |
|
711 | // if ((i + j) % 8 == 0) | |
|
712 | // { | |
|
713 | // drawTileAt(i, j, 141, 2); | |
|
714 | // } | |
|
715 | // else | |
|
716 | // { | |
|
717 | // drawTileAt(i, j, 142, 2); | |
|
718 | // } | |
|
719 | } | |
|
720 | else if (this.simulation.map.cells[i][j].status == CellStatus.DeadTree) { | |
|
712 | 721 | drawTileAt(i, j, 141, 2); |
|
713 | } | |
|
714 | else | |
|
715 | { | |
|
716 | drawTileAt(i, j, 142, 2); | |
|
717 | } | |
|
718 | } | |
|
722 | // System.Console.WriteLine(String.Format("Drew Dead Tree at {0},{1}", i, j)); | |
|
723 | ||
|
724 | } | |
|
719 | 725 | } |
|
720 | 726 | } |
|
721 | 727 | #endregion draw_trees |
You need to be logged in to leave comments.
Login now