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 | private bool showGrid; |
|
77 | private bool showGrid; |
|
|
78 | private bool showTrees; | ||
|
78 | private Grammar grammar; |
|
79 | private Grammar grammar; |
|
79 | private string output; |
|
80 | private string output; |
|
80 | private GraphicsDeviceManager gdm; |
|
81 | private GraphicsDeviceManager gdm; |
@@ -139,6 +140,7 | |||||
|
139 | showForest = false; |
|
140 | showForest = false; |
|
140 | showNews = false; |
|
141 | showNews = false; |
|
141 | showGrid = true; |
|
142 | showGrid = true; |
|
|
143 | showTrees = true; | ||
|
142 |
|
144 | ||
|
143 | this.Window.Title = "Isometric Park"; |
|
145 | this.Window.Title = "Isometric Park"; |
|
144 |
|
146 | ||
@@ -367,6 +369,13 | |||||
|
367 | this.showGrid = !this.showGrid; |
|
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 | if (keyboardCur.IsKeyDown(Keys.B) && keyboardPrev.IsKeyUp(Keys.B)) |
|
379 | if (keyboardCur.IsKeyDown(Keys.B) && keyboardPrev.IsKeyUp(Keys.B)) |
|
371 | { |
|
380 | { |
|
372 | this.showBudget = !this.showBudget; |
|
381 | this.showBudget = !this.showBudget; |
@@ -756,27 +765,29 | |||||
|
756 | }//*/ |
|
765 | }//*/ |
|
757 |
|
766 | ||
|
758 | #region draw_trees |
|
767 | #region draw_trees |
|
759 | for (int i = 0; i < this.simulation.map.MapHeight; i++) |
|
768 | if (this.showTrees) { |
|
760 | { |
|
769 | for (int i = 0; i < this.simulation.map.MapHeight; i++) |
|
761 | for (int j = 0; j < this.simulation.map.MapWidth; j += 1) |
|
||
|
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) |
|
774 | if (this.simulation.map.cells[i][j].hasTree) |
|
765 | { //until we actually simulate: |
|
775 | { //until we actually simulate: |
|
766 | drawTileAt(i, j, 142, 2); |
|
776 | drawTileAt(i, j, 142, 2); |
|
767 | // if ((i + j) % 8 == 0) |
|
777 | // if ((i + j) % 8 == 0) |
|
768 | // { |
|
778 | // { |
|
769 | // drawTileAt(i, j, 141, 2); |
|
779 | // drawTileAt(i, j, 141, 2); |
|
770 | // } |
|
780 | // } |
|
771 | // else |
|
781 | // else |
|
772 | // { |
|
782 | // { |
|
773 | // drawTileAt(i, j, 142, 2); |
|
783 | // drawTileAt(i, j, 142, 2); |
|
774 | // } |
|
784 | // } |
|
775 | } |
|
785 | } |
|
776 | else if (this.simulation.map.cells[i][j].status == CellStatus.DeadTree) { |
|
786 | else if (this.simulation.map.cells[i][j].status == CellStatus.DeadTree) { |
|
777 | drawTileAt(i, j, 141, 2); |
|
787 | drawTileAt(i, j, 141, 2); |
|
778 | // System.Console.WriteLine(String.Format("Drew Dead Tree at {0},{1}", i, j)); |
|
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