114 short problemTable[PROBNUM];
115 for (
int z = 0; z < PROBNUM; z++) {
145 for (
int i = 0; i < PROBNUM; i++) {
188 if (oldCityPop == -1) {
214 if (cityPopulation > 2000) {
217 if (cityPopulation > 10000) {
220 if (cityPopulation > 50000) {
223 if (cityPopulation > 100000) {
226 if (cityPopulation > 500000) {
230 return cityClassification;
243 bool problemTaken[PROBNUM];
245 for (
int z = 0; z < PROBNUM; z++) {
246 problemTaken[z] =
false;
264 if ((
problemVotes[i] > maxVotes) && (!problemTaken[i])) {
273 problemTaken[bestProblem] =
true;
290 for (
int z = 0; z < PROBNUM; z++) {
297 while (voteCount < 100 && loopCount < 600) {
298 if (
getRandom(300) < problemTable[problem]) {
303 if (problem > PROBNUM) {
350 float r = ((float)
resPop) / b;
352 b = (short)((r - 1) * 255);
353 return min(b, (
short)255);
380 x += problemTable[z];
389 z =
clamp((256 - x) * 4, 0, 1000);
417 if (resValve < -1000) {
421 if (comValve < -1000) {
425 if (indValve < -1000) {
452 z =
clamp(z, 0, 1000);
470 for (z = 0; z < 100; z++) {
503 callback->updateEvaluation(
this, callbackVal);
DATA worldGet(int x, int y) const
short problemVotes[PROBNUM]
short stadiumPop
Number of stadiums.
short poweredZoneCount
Number of powered tiles in all zone.
CityClass getCityClass(Quad cityPop)
void voteProblems(const short problemTable[PROBNUM])
short unpoweredZoneCount
Number of unpowered tiles in all zones.
bool evalChanged
The evaluation window should be shown to the user.
void getScore(const short problemTable[PROBNUM])
short getRandom(short range)
short problemOrder[CVP_PROBLEM_COMPLAINTS]
short getTrafficAverage()
bool indCap
Block industrial growth.
bool resCap
Block residential growth.
void doProblems(short problemTable[PROBNUM])
int getProblemNumber(int i)
short hospitalPop
Number of hospitals.
int getProblemVotes(int i)
MapByte2 trafficDensityMap
Traffic density map.
bool comCap
Block commercial growth.
CityClass cityClass
City class, affected by city population.
MapByte2 landValueMap
Land value map.
Header file for Micropolis game engine.
@ CC_CAPITAL
Capital, > 50000 citizens.
@ CC_MEGALOPOLIS
Megalopolis, > 500000 citizens.
@ CC_METROPOLIS
Metropolis, > 100000 citizens.
@ CC_CITY
City, > 10000 citizens.
@ CC_TOWN
Town, > 2000 citizens.
static const int MAX_FIRE_STATION_EFFECT
static T min(const T a, const T b)
@ CVP_NUMPROBLEMS
Number of problems.
@ CVP_POLLUTION
Pollution.
@ CVP_UNEMPLOYMENT
Unemployment.
@ CVP_PROBLEM_COMPLAINTS
Number of problems to complain about.
static const int MAX_ROAD_EFFECT
static const int MAX_POLICE_STATION_EFFECT
static T clamp(const T val, const T lower, const T upper)