Description:
Add tree show/hide for debugging at least.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -75,6 +75,7 | |||
|
75 | 75 | |
|
76 | 76 | |
|
77 | 77 | private bool showGrid; |
|
78 | private bool showTrees; | |
|
78 | 79 | private Grammar grammar; |
|
79 | 80 | private string output; |
|
80 | 81 | private GraphicsDeviceManager gdm; |
@@ -139,6 +140,7 | |||
|
139 | 140 | showForest = false; |
|
140 | 141 | showNews = false; |
|
141 | 142 | showGrid = true; |
|
143 | showTrees = true; | |
|
142 | 144 | |
|
143 | 145 | this.Window.Title = "Isometric Park"; |
|
144 | 146 | |
@@ -367,6 +369,13 | |||
|
367 | 369 | this.showGrid = !this.showGrid; |
|
368 | 370 | |
|
369 | 371 | } |
|
372 | #if DEBUG | |
|
373 | if (keyboardCur.IsKeyDown(Keys.T) && keyboardPrev.IsKeyUp(Keys.T)) | |
|
374 | { | |
|
375 | this.showTrees = !this.showTrees; | |
|
376 | ||
|
377 | } | |
|
378 | #endif | |
|
370 | 379 | if (keyboardCur.IsKeyDown(Keys.B) && keyboardPrev.IsKeyUp(Keys.B)) |
|
371 | 380 | { |
|
372 | 381 | this.showBudget = !this.showBudget; |
@@ -756,27 +765,29 | |||
|
756 | 765 | }//*/ |
|
757 | 766 | |
|
758 | 767 | #region draw_trees |
|
759 | for (int i = 0; i < this.simulation.map.MapHeight; i++) | |
|
760 | { | |
|
761 | for (int j = 0; j < this.simulation.map.MapWidth; j += 1) | |
|
768 | if (this.showTrees) { | |
|
769 | for (int i = 0; i < this.simulation.map.MapHeight; i++) | |
|
762 | 770 | { |
|
771 | for (int j = 0; j < this.simulation.map.MapWidth; j += 1) | |
|
772 | { | |
|
763 | 773 | |
|
764 | if (this.simulation.map.cells[i][j].hasTree) | |
|
765 | { //until we actually simulate: | |
|
766 | drawTileAt(i, j, 142, 2); | |
|
767 | // if ((i + j) % 8 == 0) | |
|
768 | // { | |
|
769 | // drawTileAt(i, j, 141, 2); | |
|
770 | // } | |
|
771 | // else | |
|
772 | // { | |
|
773 | // drawTileAt(i, j, 142, 2); | |
|
774 | // } | |
|
775 | } | |
|
776 | else if (this.simulation.map.cells[i][j].status == CellStatus.DeadTree) { | |
|
777 | drawTileAt(i, j, 141, 2); | |
|
778 | // System.Console.WriteLine(String.Format("Drew Dead Tree at {0},{1}", i, j)); | |
|
774 | if (this.simulation.map.cells[i][j].hasTree) | |
|
775 | { //until we actually simulate: | |
|
776 | drawTileAt(i, j, 142, 2); | |
|
777 | // if ((i + j) % 8 == 0) | |
|
778 | // { | |
|
779 | // drawTileAt(i, j, 141, 2); | |
|
780 | // } | |
|
781 | // else | |
|
782 | // { | |
|
783 | // drawTileAt(i, j, 142, 2); | |
|
784 | // } | |
|
785 | } | |
|
786 | else if (this.simulation.map.cells[i][j].status == CellStatus.DeadTree) { | |
|
787 | drawTileAt(i, j, 141, 2); | |
|
788 | // System.Console.WriteLine(String.Format("Drew Dead Tree at {0},{1}", i, j)); | |
|
779 | 789 | |
|
790 | } | |
|
780 | 791 | } |
|
781 | 792 | } |
|
782 | 793 | } |
You need to be logged in to leave comments.
Login now