Description:
Add basic infrastructure to store and display visitor count.
May eventually move to simulating visitors as entities. We'll see.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -931,7 +931,7 | |||||
|
931 | } |
|
931 | } |
|
932 | } |
|
932 | } |
|
933 |
|
933 | ||
|
934 | String header_left = String.Format("${0:}|{1:} \ue124", this.simulation.money, this.simulation.map.tree_count); |
|
934 | String header_left = String.Format("${0:}|{1:} \ue124|{2:} \ue12c", this.simulation.money, this.simulation.map.tree_count, this.simulation.visitor_count); |
|
935 | String header_middle = String.Format("{0:MMMMM yyyy} ({1:})", this.simulation.DateTime, this.simulation.Season); |
|
935 | String header_middle = String.Format("{0:MMMMM yyyy} ({1:})", this.simulation.DateTime, this.simulation.Season); |
|
936 | // String header_right = String.Format("Press H for help."); |
|
936 | // String header_right = String.Format("Press H for help."); |
|
937 | String header_right = ""; |
|
937 | String header_right = ""; |
@@ -36,11 +36,14 | |||||
|
36 | public decimal cashflow; |
|
36 | public decimal cashflow; |
|
37 |
|
37 | ||
|
38 |
|
38 | ||
|
39 | //misc |
|
39 | //misc trees |
|
40 | public int trees; |
|
40 | public int trees; |
|
41 | public int dead_trees; |
|
41 | public int dead_trees; |
|
42 | public int crowded_trees; |
|
42 | public int crowded_trees; |
|
43 | public int preserve_cells; |
|
43 | public int preserve_cells; |
|
|
44 | |||
|
|
45 | //misc | ||
|
|
46 | public int visitor_count; | ||
|
44 | //Kind of a hack but allows for tracking figures over time without creating a whole new infrastructure |
|
47 | //Kind of a hack but allows for tracking figures over time without creating a whole new infrastructure |
|
45 |
|
48 | ||
|
46 | } |
|
49 | } |
@@ -115,6 +118,8 | |||||
|
115 |
|
118 | ||
|
116 | public int preserve_cells; |
|
119 | public int preserve_cells; |
|
117 |
|
120 | ||
|
|
121 | public int visitor_count; | ||
|
|
122 | |||
|
118 | public Budget latestBudget |
|
123 | public Budget latestBudget |
|
119 | { |
|
124 | { |
|
120 | get |
|
125 | get |
@@ -257,6 +262,7 | |||||
|
257 |
|
262 | ||
|
258 | this.map = new CellMap(width, height); |
|
263 | this.map = new CellMap(width, height); |
|
259 | this.money = STARTING_FUNDS; |
|
264 | this.money = STARTING_FUNDS; |
|
|
265 | this.visitor_count = 0; | ||
|
260 | this.millisecondsPerAdvance = millisecondsPerAdvance; |
|
266 | this.millisecondsPerAdvance = millisecondsPerAdvance; |
|
261 |
|
267 | ||
|
262 | this.paused = true; |
|
268 | this.paused = true; |
@@ -279,6 +285,7 | |||||
|
279 | private void advanceSimulation() |
|
285 | private void advanceSimulation() |
|
280 | { |
|
286 | { |
|
281 | var oldSeason = this.Season; |
|
287 | var oldSeason = this.Season; |
|
|
288 | //Advance clock | ||
|
282 | this.DateTime = this.DateTime.AddMonths(1); |
|
289 | this.DateTime = this.DateTime.AddMonths(1); |
|
283 | this.Subsidy = Math.Max(0, this.Subsidy + this.SubsidyDelta); |
|
290 | this.Subsidy = Math.Max(0, this.Subsidy + this.SubsidyDelta); |
|
284 | var newSeason = this.Season; |
|
291 | var newSeason = this.Season; |
@@ -363,7 +370,8 | |||||
|
363 | tree_planting = this.tree_planting * Simulation.TREE_PLANT_COST, |
|
370 | tree_planting = this.tree_planting * Simulation.TREE_PLANT_COST, |
|
364 | tree_clearing = this.tree_clearing * Simulation.TREE_CLEAR_COST, |
|
371 | tree_clearing = this.tree_clearing * Simulation.TREE_CLEAR_COST, |
|
365 | misc = this.misc, |
|
372 | misc = this.misc, |
|
366 | preserve_cells = this.preserve_cells |
|
373 | preserve_cells = this.preserve_cells, |
|
|
374 | visitor_count = this.visitor_count | ||
|
367 | }; |
|
375 | }; |
|
368 |
|
376 | ||
|
369 | newBudget = this.applyBudget(newBudget); ; |
|
377 | newBudget = this.applyBudget(newBudget); ; |
You need to be logged in to leave comments.
Login now