Methapolis  0.27
 All Classes Namespaces Files Functions Variables Enumerator
PlayerInfo.java
Go to the documentation of this file.
1 package micropolisj.engine;
2 
3 import java.io.Serializable;
4 import java.util.Stack;
5 
6 import micropolisj.research.ResearchData;
7 import micropolisj.research.ResearchState;
8 
15 public class PlayerInfo implements Serializable {
16  //TODO: decide which variables are playerrelated and which ones are maprelated!!!
17  // playerrelated --> PlayerInfo
18  // maprelated --> Micropolis
19 
20  public int countdown;
21 
22  public boolean [][]powermap;
24 
25  public boolean autoBulldoze = true;
26  public boolean autoBudget = false;
27 
28  // census numbers, reset in phase 0 of each cycle, summed during map scan
29  public int poweredZoneCount;
30  public int unpoweredZoneCount;
31  public int roadTotal;
32  public int railTotal;
33  public int firePop;
34  public int resZoneCount;
35  public int comZoneCount;
36  public int indZoneCount;
37  public int resPop;
38  public int comPop;
39  public int indPop;
40  public int hospitalCount;
41  public int churchCount;
42  public int policeCount;
43  public int fireStationCount;
44  public int stadiumCount;
45  public int coalCount;
46  public int nuclearCount;
47  public int seaportCount;
48  public int airportCount;
49 
50  // CUSTOM
51  public int researchCount;
52  public int tempelCount;
53 
54  public int totalPop;
55  public int lastCityPop;
56 
57  // used in generateBudget()
58  public int lastRoadTotal;
59  public int lastRailTotal;
60  public int lastTotalPop;
62  public int lastPoliceCount;
63  public int lastResearchCount;
64 
65  public int trafficMaxLocationX;
66  public int trafficMaxLocationY;
69  public int crimeMaxLocationX;
70  public int crimeMaxLocationY;
71  public int centerMassX;
72  public int centerMassY;
73 
74  public int needHospital; // -1 too many already, 0 just right, 1 not enough
75  public int needChurch; // -1 too many already, 0 just right, 1 not enough
76 
77  public int crimeAverage;
78  public int pollutionAverage;
79  public int landValueAverage;
80  public int trafficAverage;
81 
82  public int resValve; // ranges between -2000 and 2000, updated by setValves
83  public int comValve; // ranges between -1500 and 1500
84  public int indValve; // ranges between -1500 and 1500
85 
86  public boolean resCap; // residents demand a stadium, caps resValve at 0
87  public boolean comCap; // commerce demands airport, caps comValve at 0
88  public boolean indCap; // industry demands sea port, caps indValve at 0
89  public int crimeRamp;
90  public int polluteRamp;
91 
92 
93  //
94  // budget stuff
95  //
96  public int cityTax = 7;
97  public double roadPercent = 1.0;
98  public double policePercent = 1.0;
99  public double firePercent = 1.0;
100  public double researchPercent = 1.0;
101 
102  public int taxEffect = 7;
103  public int roadEffect = 32;
104  public int policeEffect = 1000;
105  public int fireEffect = 1000;
106  public int researchEffect = 1000;
107 
108  public int cashFlow; // net change in totalFunds in previous year
109 
110  public boolean newPower;
111 
112 // public Stack<CityLocation> powerPlants = new Stack<CityLocation>();
113 
114  public transient ResearchState researchState;
115 
118 
119  // CONSTRUCTOR
120  public PlayerInfo(Micropolis city) {
121  this(new ResearchState(city), new CityEval(city), new CityBudget(city));
122  }
123 
125  this.countdown = 10;
126  this.researchState = researchState;
127  this.researchData = researchState.getResearchData();
128  this.evaluation = cityEval;
129  this.budget = budget;
130  }
131 
132  public void setResearchState(ResearchState state) {
133  this.researchState = state;
134  }
135 
136 }