Micropolis
|
#include <micropolis.h>
Public Member Functions | |
Micropolis () | |
~Micropolis () | |
void | setCallback (Callback *callback, emscripten::val callbackVal) |
void | init () |
Private Member Functions | |
void | destroy () |
Historic graphs. | |
short * | resHist |
short * | comHist |
short * | indHist |
short * | moneyHist |
short * | pollutionHist |
short * | crimeHist |
short * | miscHist |
float | roadPercent |
float | policePercent |
float | firePercent |
Quad | roadValue |
Quad | policeValue |
Quad | fireValue |
int | mustDrawBudget |
short | floodCount |
short | cityYes |
short | problemVotes [PROBNUM] |
short | problemOrder [CVP_PROBLEM_COMPLAINTS] |
Quad | cityPop |
Quad | cityPopDelta |
Quad | cityAssessedValue |
CityClass | cityClass |
City class, affected by city population. | |
short | cityScore |
short | cityScoreDelta |
short | trafficAverage |
short | needHospital |
short | needChurch |
unsigned short * | mapBase |
unsigned short * | mopBase |
void | animateTiles () |
void | initFundingLevel () |
void | doBudget () |
void | doBudgetFromMenu () |
void | doBudgetNow (bool fromMenu) |
void | updateBudget () |
void | showBudgetWindowAndStartWaiting () |
void | setCityTax (short tax) |
void | makeMeltdown () |
void | makeFireBombs () |
void | makeEarthquake () |
void | makeFire () |
void | makeFlood () |
void | setFire () |
void | fireBomb () |
void | cityEvaluation () |
void | evalInit () |
void | doScoreCard () |
void | changeEval () |
void | scoreDoer () |
int | countProblems () |
int | getProblemNumber (int i) |
int | getProblemVotes (int i) |
bool | loadFileData (const std::string &filename) |
bool | loadFile (const std::string &filename) |
bool | saveFile (const std::string &filename) |
void | loadScenario (Scenario s) |
void | didLoadScenario (int s, const std::string name, const std::string fname) |
bool | loadCity (const std::string &filename) |
void | didLoadCity (const std::string &filename) |
void | didntLoadCity (const std::string &msg) |
void | saveCity () |
void | doSaveCityAs (const std::string &filename) |
void | didSaveCity (const std::string &filename) |
void | didntSaveCity (const std::string &msg) |
void | saveCityAs (const std::string &filename) |
void | initMapArrays () |
void | destroyMapArrays () |
ToolResult | connectTile (short x, short y, ConnectTileCommand cmd, ToolEffects *effects) |
ToolResult | layDoze (int x, int y, ToolEffects *effects) |
ToolResult | layRoad (int x, int y, ToolEffects *effects) |
ToolResult | layRail (int x, int y, ToolEffects *effects) |
ToolResult | layWire (int x, int y, ToolEffects *effects) |
void | fixZone (int x, int y, ToolEffects *effects) |
void | fixSingle (int x, int y, ToolEffects *effects) |
void | doDisasters () |
void | scenarioDisaster () |
bool | vulnerable (int tem) |
void | doFlood (const Position &pos) |
void | getAssessedValue () |
void | doPopNum () |
Quad | getPopulation () |
CityClass | getCityClass (Quad cityPop) |
void | doProblems (short problemTable[PROBNUM]) |
void | voteProblems (const short problemTable[PROBNUM]) |
short | getTrafficAverage () |
short | getUnemployment () |
short | getFireSeverity () |
void | getScore (const short problemTable[PROBNUM]) |
void | doVotes () |
static int | getNextAnimatedTile (int index) |
Terrain generator. | |
features available incrementally as city building tools. The user should be able to place water and trees, and it should dynamically smooth the edges. The user interface could restrict the user to only drawing terrain before any zones were built, but it would be best if the terrain editing tools worked properly when there were zones built (by automatically bulldozing zones whose underlying terrain it's modifying). | |
int | terrainTreeLevel |
int | terrainLakeLevel |
int | terrainCurveLevel |
int | terrainCreateIsland |
int | generatedCitySeed |
bool | historyInitialized |
short | graph10Max |
short | graph120Max |
int | simLoops |
int | simPasses |
int | simPass |
bool | simPaused |
int | simPausedSpeed |
bool | tilesAnimated |
bool | doAnimation |
bool | doMessages |
bool | doNotices |
std::string | cityFileName |
Filename of the last loaded city. | |
std::string | cityName |
Name of the city. | |
int | heatSteps |
int | heatFlow |
int | heatRule |
int | heatWrap |
Quad | cityPopLast |
Population of last city class check. | |
short | categoryLast |
City class of last city class check. | |
bool | autoGoto |
short * | cellSrc |
short * | cellDst |
void | generateSomeRandomCity () |
void | clearMap () |
void | clearUnnatural () |
void | makeIsland () |
void | treeSplash (short xloc, short yloc) |
void | makeSingleLake (const Position &pos) |
void | plopBRiver (const Position &pos) |
void | plopSRiver (const Position &pos) |
void | generateSomeCity (int seed) |
void | generateMap (int seed) |
void | drawMonth (short *hist, unsigned char *s, float scale) |
void | changeCensus () |
void | graphDoer () |
void | initGraphs () |
void | initGraphMax () |
void | getHistoryRange (int historyType, int historyScale, short *minValResult, short *maxValResult) |
short | getHistory (int historyType, int historyScale, int historyIndex) |
void | setHistory (int historyType, int historyScale, int historyIndex, short historyValue) |
std::string | getMicropolisVersion () |
void | simUpdate () |
void | simTick () |
void | simulateRobots () |
long | getMapAddress () |
long | getMapSize () |
long | getMopAddress () |
long | getMopSize () |
void | sendMessages () |
void | checkGrowth () |
void | doScenarioScore (Scenario type) |
void | sendMessage (short Mnum, short x=NOWHERE, short y=NOWHERE, bool picture=false, bool important=false) |
void | doMakeSound (int mesgNum, int x, int y) |
void | doAutoGoto (short x, short y, const std::string &message) |
void | doLoseGame () |
void | doWinGame () |
void | makeNakedIsland () |
void | doTrees () |
bool | isTree (MapValue cell) |
void | smoothTrees () |
void | smoothTreesAt (int x, int y, bool preserve) |
void | smoothTreesAt (int x, int y, bool preserve, ToolEffects *effects) |
void | makeLakes () |
void | doRivers (const Position &terrainPos) |
Direction2 | doBRiver (const Position &riverPos, Direction2 riverDir, Direction2 terrainDir) |
Direction2 | doSRiver (const Position &riverPos, Direction2 riverDir, Direction2 terrainDir) |
void | smoothRiver () |
void | smoothWater () |
void | putOnMap (MapValue mChar, short xLoc, short yLoc) |
void | initWillStuff () |
void | resetMapState () |
void | resetEditorState () |
void | simInit () |
void | simHeat () |
void | simLoop (bool doSim) |
Power stack | |
Stack used to find powered tiles by tracking conductive tiles. | |
UQuad | nextRandom |
short | newMap |
short | newMapFlags [MAP_TYPE_COUNT] |
short | cityCenterX |
X coordinate of city center. | |
short | cityCenterY |
Y coordinate of city center. | |
short | pollutionMaxX |
X coordinate of most polluted area. | |
short | pollutionMaxY |
Y coordinate of most polluted area. | |
short | crimeMaxX |
X coordinate of most criminal area. Not used. | |
short | crimeMaxY |
Y coordinate of most criminal area. Not used. | |
Quad | donDither |
bool | valveFlag |
short | crimeRamp |
short | pollutionRamp |
bool | resCap |
Block residential growth. | |
bool | comCap |
Block commercial growth. | |
bool | indCap |
Block industrial growth. | |
short | cashFlow |
float | externalMarket |
Scenario | disasterEvent |
The disaster for which a count-down is running. | |
short | disasterWait |
Count-down timer for the disaster. | |
Scenario | scoreType |
The type of score table to use. | |
short | scoreWait |
Time to wait before computing the score. | |
short | poweredZoneCount |
Number of powered tiles in all zone. | |
short | unpoweredZoneCount |
Number of unpowered tiles in all zones. | |
bool | newPower |
short | cityTaxAverage |
short | simCycle |
short | phaseCycle |
short | speedCycle |
bool | doInitialEval |
Need to perform initial city evaluation. | |
int | mapSerial |
The invalidateMaps method increases the map serial number every time the maps changes. | |
short | resValve |
short | comValve |
short | indValve |
SimSprite * | spriteList |
List of active sprites. | |
Quad | totalFunds |
Funds of the player. | |
bool | autoBulldoze |
bool | autoBudget |
Quad | messageTimeLast |
GameLevel | gameLevel |
Difficulty level of the game (0..2) | |
short | initSimLoad |
Scenario | scenario |
Scenario being played. | |
short | simSpeed |
short | simSpeedMeta |
bool | enableSound |
Enable sound. | |
bool | enableDisasters |
Enable disasters. | |
short | messageNumber |
bool | evalChanged |
The evaluation window should be shown to the user. | |
short | blinkFlag |
emscripten::val | callbackVal |
void * | callbackData |
void * | userData |
bool | mustUpdateFunds |
bool | mustUpdateOptions |
Options displayed at user need updating. | |
Quad | cityTimeLast |
Quad | cityYearLast |
Quad | cityMonthLast |
Quad | totalFundsLast |
Quad | resLast |
Quad | comLast |
Quad | indLast |
int | powerStackPointer |
Stack counter, points to top-most item. | |
Position | powerStackXY [POWER_STACK_SIZE] |
SimSprite * | freeSprites |
Pool of free SimSprite objects. | |
SimSprite * | globalSprites [SPRITE_COUNT] |
int | absDist |
short | spriteCycle |
short | curMapStackPointer |
Position | curMapStackXY [MAX_TRAFFIC_DISTANCE+1] |
Position stack. | |
short | trafMaxX |
X coordinate of a position with heavy traffic. | |
short | trafMaxY |
Y coordinate of a position with heavy traffic. | |
int | simRandom () |
short | getRandom (short range) |
int | getRandom16 () |
int | getRandom16Signed () |
short | getERandom (short limit) |
void | randomlySeedRandom () |
void | seedRandom (int seed) |
void | fireAnalysis () |
void | populationDensityScan () |
int | getPopulationDensity (const Position &pos, MapTile tile) |
void | pollutionTerrainLandValueScan () |
int | getPollutionValue (int loc) |
int | getCityCenterDistance (int x, int y) |
void | crimeScan () |
void | smoothTerrain () |
void | doSmooth1 () |
void | doSmooth2 () |
void | computeComRateMap () |
void | updateFundEffects () |
SimSprite * | newSprite (const std::string &name, int type, int x, int y) |
void | initSprite (SimSprite *sprite, int x, int y) |
void | destroyAllSprites () |
void | destroySprite (SimSprite *sprite) |
SimSprite * | getSprite (int type) |
SimSprite * | makeSprite (int type, int x, int y) |
short | getChar (int x, int y) |
short | turnTo (int p, int d) |
bool | tryOther (int Tpoo, int Told, int Tnew) |
bool | spriteNotInBounds (SimSprite *sprite) |
short | getDir (int orgX, int orgY, int desX, int desY) |
int | getDistance (int x1, int y1, int x2, int y2) |
bool | checkSpriteCollision (SimSprite *s1, SimSprite *s2) |
void | moveObjects () |
void | doTrainSprite (SimSprite *sprite) |
void | doCopterSprite (SimSprite *sprite) |
void | doAirplaneSprite (SimSprite *sprite) |
void | doShipSprite (SimSprite *sprite) |
void | doMonsterSprite (SimSprite *sprite) |
void | doTornadoSprite (SimSprite *sprite) |
void | doExplosionSprite (SimSprite *sprite) |
void | doBusSprite (SimSprite *sprite) |
int | canDriveOn (int x, int y) |
void | explodeSprite (SimSprite *sprite) |
bool | checkWet (int x) |
void | destroyMapTile (int ox, int oy) |
void | startFireInZone (int Xloc, int Yloc, int ch) |
void | startFire (int x, int y) |
void | generateTrain (int x, int y) |
void | generateBus (int x, int y) |
void | generateShip () |
void | makeShipHere (int x, int y) |
void | makeMonster () |
void | makeMonsterAt (int x, int y) |
void | generateCopter (const Position &pos) |
void | generatePlane (const Position &pos) |
void | makeTornado () |
void | makeExplosion (int x, int y) |
void | makeExplosionAt (int x, int y) |
void | spend (int dollars) |
void | setFunds (int dollars) |
Quad | tickCount () |
Ptr | newPtr (int size) |
void | freePtr (void *data) |
void | doStartScenario (int scenario) |
void | doStartGame () |
void | initGame () |
void | doEarthquake (int strength) |
void | invalidateMaps () |
void | makeSound (const std::string &channel, const std::string &sound, int x=-1, int y=-1) |
int | getTile (int x, int y) |
void | setTile (int x, int y, int tile) |
void * | getMapBuffer () |
int | getPowerGrid (int x, int y) |
void | setPowerGrid (int x, int y, int power) |
void * | getPowerGridMapBuffer () |
int | getPopulationDensity (int x, int y) |
void | setPopulationDensity (int x, int y, int density) |
void * | getPopulationDensityMapBuffer () |
int | getRateOfGrowth (int x, int y) |
void | setRateOfGrowth (int x, int y, int rate) |
void * | getRateOfGrowthMapBuffer () |
int | getTrafficDensity (int x, int y) |
void | setTrafficDensity (int x, int y, int density) |
void * | getTrafficDensityMapBuffer () |
int | getPollutionDensity (int x, int y) |
void | setPollutionDensity (int x, int y, int density) |
void * | getPollutionDensityMapBuffer () |
int | getCrimeRate (int x, int y) |
void | setCrimeRate (int x, int y, int rate) |
void * | getCrimeRateMapBuffer () |
int | getLandValue (int x, int y) |
void | setLandValue (int x, int y, int value) |
void * | getLandValueMapBuffer () |
int | getFireCoverage (int x, int y) |
void | setFireCoverage (int x, int y, int coverage) |
void * | getFireCoverageMapBuffer () |
int | getPoliceCoverage (int x, int y) |
void | setPoliceCoverage (int x, int y, int coverage) |
void * | getPoliceCoverageMapBuffer () |
ToolResult | doTool (EditingTool tool, short tileX, short tileY) |
void | toolDown (EditingTool tool, short tileX, short tileY) |
void | toolDrag (EditingTool tool, short fromX, short fromY, short toX, short toY) |
void | didTool (std::string name, short x, short y) |
short | makeTrafficAt (int x, int y, ZoneType dest) |
short | makeTraffic (int x, int y, ZoneType dest) |
void | doUpdateHeads () |
void | updateMaps () |
void | updateGraphs () |
void | updateEvaluation () |
void | updateHeads () |
void | updateFunds () |
void | reallyUpdateFunds () |
void | doTimeStuff () |
void | updateDate () |
void | showValves () |
void | drawValve () |
void | setDemand (float r, float c, float i) |
void | updateOptions () |
void | updateUserInterface () |
void | pause () |
void | resume () |
void | setSpeed (short speed) |
void | setPasses (int passes) |
void | setGameLevelFunds (GameLevel level) |
void | setGameLevel (GameLevel level) |
void | updateGameLevel () |
void | setCityName (const std::string &name) |
void | setCleanCityName (const std::string &name) |
void | setYear (int year) |
int | currentYear () |
void | doNewGame () |
void | setEnableDisasters (bool value) |
void | setAutoBudget (bool value) |
void | setAutoBulldoze (bool value) |
void | setAutoGoto (bool value) |
void | setEnableSound (bool value) |
void | setDoAnimation (bool value) |
void | setDoMessages (bool value) |
void | setDoNotices (bool value) |
void | getDemands (float *resDemandResult, float *comDemandResult, float *indDemandResult) |
void | doPowerScan () |
bool | testForConductive (const Position &pos, Direction2 testDir) |
void | pushPowerStack (const Position &pos) |
Position | pullPowerStack () |
MapValue | randomFire () |
MapValue | randomRubble () |
void | simFrame () |
void | simulate () |
void | doSimInit () |
void | doNilPower () |
void | decTrafficMap () |
void | decRateOfGrowthMap () |
void | initSimMemory () |
void | simLoadInit () |
void | setCommonInits () |
void | setValves () |
void | clearCensus () |
void | take10Census () |
void | take120Census () |
void | collectTax () |
void | mapScan (int x1, int x2) |
void | doRail (const Position &pos) |
void | doRadTile (const Position &pos) |
void | doRoad (const Position &pos) |
bool | doBridge (const Position &pos, MapTile tile) |
int | getBoatDistance (const Position &pos) |
void | doFire (const Position &pos) |
void | fireZone (const Position &pos, MapValue ch) |
void | repairZone (const Position &pos, MapTile zCent, short zSize) |
void | doSpecialZone (const Position &pos, bool PwrOn) |
void | drawStadium (const Position ¢er, MapTile z) |
void | doAirport (const Position &pos) |
void | coalSmoke (const Position &pos) |
void | doMeltdown (const Position &pos) |
ToolResult | queryTool (short x, short y) |
ToolResult | bulldozerTool (short x, short y) |
ToolResult | bulldozerTool (short x, short y, ToolEffects *effects) |
ToolResult | roadTool (short x, short y, ToolEffects *effects) |
ToolResult | railroadTool (short x, short y, ToolEffects *effects) |
ToolResult | wireTool (short x, short y, ToolEffects *effects) |
ToolResult | parkTool (short x, short y, ToolEffects *effects) |
ToolResult | buildBuildingTool (short x, short y, const BuildingProperties *bprops, ToolEffects *effects) |
ToolResult | networkTool (short x, short y, ToolEffects *effects) |
ToolResult | waterTool (short x, short y, ToolEffects *effects) |
ToolResult | landTool (short x, short y, ToolEffects *effects) |
ToolResult | forestTool (short x, short y, ToolEffects *effects) |
ToolResult | putDownPark (short mapH, short mapV, ToolEffects *effects) |
ToolResult | putDownNetwork (short mapH, short mapV, ToolEffects *effects) |
ToolResult | putDownWater (short mapH, short mapV, ToolEffects *effects) |
ToolResult | putDownLand (short mapH, short mapV, ToolEffects *effects) |
ToolResult | putDownForest (short mapH, short mapV, ToolEffects *effects) |
void | doZoneStatus (short mapH, short mapV) |
void | doShowZoneStatus (int tileCategoryIndex, int populationDensityIndex, int landValueIndex, int crimeRateIndex, int pollutionIndex, int growthRateIndex, int x, int y) |
void | putBuilding (int leftX, int topY, int sizeX, int sizeY, MapTile baseTile, bool aniFlag, ToolEffects *effects) |
ToolResult | prepareBuildingSite (int leftX, int topY, int sizeX, int sizeY, ToolEffects *effects) |
ToolResult | buildBuilding (int mapH, int mapV, const BuildingProperties *bprops, ToolEffects *effects) |
int | getDensity (short catNo, short mapH, short mapV) |
bool | tally (short tileValue) |
short | checkSize (short tileValue) |
void | checkBorder (short xMap, short yMap, int sizeX, int sizeY, ToolEffects *effects) |
void | putRubble (int x, int y, int size, ToolEffects *effects) |
short | makeTraffic (const Position &startPos, ZoneType dest) |
void | addToTrafficDensityMap () |
void | pushPos (const Position &pos) |
Position | pullPos () |
bool | findPerimeterRoad (Position *pos) |
bool | findPerimeterTelecom (const Position &pos) |
bool | tryDrive (const Position &startPos, ZoneType destZone) |
Direction2 | tryGo (const Position &pos, Direction2 dirLast) |
MapTile | getTileFromMap (const Position &pos, Direction2 dir, MapTile defaultTile) |
bool | driveDone (const Position &pos, ZoneType destZone) |
bool | roadTest (MapValue tile) |
std::string | makeDollarDecimalStr (const std::string &numStr) |
void | doZone (const Position &pos) |
void | doHospitalChurch (const Position &pos) |
void | setSmoke (const Position &pos, bool zonePower) |
void | makeHospital (const Position &pos) |
short | getLandPollutionValue (const Position &pos) |
void | incRateOfGrowth (const Position &pos, int amount) |
bool | zonePlop (const Position &pos, int base) |
short | doFreePop (const Position &pos) |
bool | setZonePower (const Position &pos) |
void | buildHouse (const Position &pos, int value) |
short | evalLot (int x, int y) |
void | doResidential (const Position &pos, bool zonePower) |
void | doResIn (const Position &pos, int pop, int value) |
void | doResOut (const Position &pos, int pop, int value) |
short | getResZonePop (MapTile mapTile) |
void | resPlop (const Position &pos, int Den, int Value) |
short | evalRes (const Position &pos, int traf) |
void | doCommercial (const Position &pos, bool zonePower) |
void | doComIn (const Position &pos, int pop, int value) |
void | doComOut (const Position &pos, int pop, int value) |
short | getComZonePop (MapTile tile) |
void | comPlop (const Position &pos, int Den, int Value) |
short | evalCom (const Position &pos, int traf) |
void | doIndustrial (const Position &pos, bool zonePower) |
void | doIndIn (const Position &pos, int pop, int value) |
void | doIndOut (const Position &pos, int pop, int value) |
short | getIndZonePop (MapTile tile) |
void | indPlop (const Position &pos, int den, int value) |
short | evalInd (int traf) |
static bool | testBounds (int wx, int wy) |
Main simulator class
Modify Micropolis::roadPercent, Micropolis::policePercent, and Micropolis::firePercent to hold real percentage from 0
to 100
instead of a floating point fraction
Micropolis::crimeMaxX and Micropolis::crimeMaxY seem unused.
Definition at line 924 of file micropolis.h.
Micropolis::Micropolis | ( | ) |
Micropolis::~Micropolis | ( | ) |
Simulator destructor.
Definition at line 111 of file micropolis.cpp.
|
private |
Update the trafficDensityMap from the positions at the curMapStackXY stack.
Definition at line 165 of file traffic.cpp.
References curMapStackPointer, SimSprite::destX, SimSprite::destY, getRandom(), getSprite(), LOMASK, map, min(), Position::posX, Position::posY, pullPos(), SPRITE_HELICOPTER, Position::testBounds(), trafficDensityMap, trafMaxX, trafMaxY, Map< DATA, BLKSIZE >::worldGet(), and Map< DATA, BLKSIZE >::worldSet().
Referenced by makeTraffic(), and makeTrafficAt().
void Micropolis::animateTiles | ( | ) |
Definition at line 211 of file animate.cpp.
|
private |
Build a building.
mapH | Horizontal position of the 'center' tile in the world. |
mapV | Vertical position of the 'center' tile in the world. |
buildingProps | Building properties of the building being constructed. |
effects | Storage of effects of putting down the building. |
Give putBuilding a BuildingProperties pointer instead.
Move cost into building properties?
Definition at line 711 of file tool.cpp.
References ToolEffects::addCost(), BuildingProperties::baseTile, BuildingProperties::buildingIsAnimated, checkBorder(), gCostOf, prepareBuildingSite(), putBuilding(), BuildingProperties::sizeX, BuildingProperties::sizeY, BuildingProperties::tool, and TOOLRESULT_OK.
Referenced by buildBuildingTool().
|
private |
Build a building.
x | Horizontal position of center tile of the new building. |
y | Vertical position of center tile of the new building. |
buildingProps | Building properties of the building being constructed. |
effects | Storage of effects of putting down the building. |
Definition at line 1225 of file tool.cpp.
References ToolEffects::addFrontendMessage(), buildBuilding(), BuildingProperties::toolName, and TOOLRESULT_OK.
Referenced by doTool().
|
private |
Try to build a house at the zone at pos.
pos | Center tile of the zone. |
value | Value to build (land value?) |
Definition at line 459 of file zone.cpp.
References evalLot(), getRandom(), getRandom16(), map, Position::posX, Position::posY, and testBounds().
Referenced by doResIn().
|
private |
|
private |
Apply bulldozer tool.
x | X coordinate of the position of the query. |
y | Y coordinate of the position of the query. |
Tool does not return TOOLRESULT_NO_MONEY.
Sometimes we can delete parts of a residential zone, but not always. Decide what rule we should have, and fix accordingly.
Definition at line 1010 of file tool.cpp.
References ToolEffects::addCost(), ToolEffects::addFrontendMessage(), checkBigZone(), checkSize(), CONNECT_TILE_BULLDOZE, connectTile(), didTool(), gCostOf, ToolEffects::getMapTile(), ToolEffects::getMapValue(), LOMASK, NOT_REACHED, putRubble(), testBounds(), TOOLRESULT_FAILED, TOOLRESULT_OK, and ZONEBIT.
int Micropolis::canDriveOn | ( | int | x, |
int | y | ||
) |
Can one drive at the specified tile?
x | X coordinate at map. |
y | Y coordinate at map. |
Definition at line 1626 of file sprite.cpp.
References DIRT, LOMASK, map, tally(), and testBounds().
Referenced by doBusSprite().
void Micropolis::changeCensus | ( | ) |
Set flag that graph data has been changed and graphs should be updated.
Definition at line 122 of file graph.cpp.
References censusChanged.
Referenced by loadFile(), and take10Census().
void Micropolis::changeEval | ( | ) |
Request that new score is displayed to the user.
Definition at line 507 of file evaluate.cpp.
References evalChanged.
Referenced by cityEvaluation(), and simInit().
|
private |
Check and connect a new zone around the border.
xMap | X coordinate of top-left tile. |
yMap | Y coordinate of top-left tile. |
sizeX | Horizontal size of the new zone. |
sizeY | Vertical size of the new zone. |
effects | Storage of the effects. |
Definition at line 575 of file tool.cpp.
References CONNECT_TILE_FIX, and connectTile().
Referenced by buildBuilding().
void Micropolis::checkGrowth | ( | ) |
Detect a change in city class, and produce a message if the player has reached the next class.
Definition at line 250 of file message.cpp.
References categoryLast, CC_CAPITAL, CC_CITY, CC_MEGALOPOLIS, CC_METROPOLIS, CC_TOWN, CC_VILLAGE, cityPopLast, cityTime, getCityClass(), getPopulation(), MESSAGE_REACHED_CAPITAL, MESSAGE_REACHED_CITY, MESSAGE_REACHED_MEGALOPOLIS, MESSAGE_REACHED_METROPOLIS, MESSAGE_REACHED_TOWN, NOT_REACHED, NOWHERE, and sendMessage().
Referenced by sendMessages().
|
private |
Return the size of the zone that the tile belongs to.
tileValue | Value of the tile in the zone. |
0
. Definition at line 548 of file tool.cpp.
References COALBASE, LASTPORT, LASTPOWERPLANT, LASTZONE, PORTBASE, and STADIUMBASE.
Referenced by bulldozerTool().
Check whether two sprites collide with each other.
s1 | First sprite. |
s2 | Second sprite. |
Definition at line 537 of file sprite.cpp.
References SimSprite::frame, getDistance(), SimSprite::x, SimSprite::xHot, SimSprite::y, and SimSprite::yHot.
Referenced by doAirplaneSprite(), doBusSprite(), doMonsterSprite(), and doTornadoSprite().
bool Micropolis::checkWet | ( | int | x | ) |
Definition at line 1698 of file sprite.cpp.
void Micropolis::cityEvaluation | ( | ) |
Evaluate city
Definition at line 110 of file evaluate.cpp.
References changeEval(), cityYes, doPopNum(), doProblems(), doVotes(), evalInit(), getAssessedValue(), getScore(), and totalPop.
|
private |
Definition at line 692 of file simulate.cpp.
void Micropolis::clearMap | ( | ) |
Clear the whole world to DIRT tiles
Definition at line 175 of file generate.cpp.
References DIRT, map, WORLD_H, and WORLD_W.
Referenced by generateMap(), and simInit().
void Micropolis::clearUnnatural | ( | ) |
|
private |
Draw coal smoke tiles around given position (of a coal power plant).
pos | Center tile of the coal power plant |
Definition at line 1668 of file simulate.cpp.
References ANIMBIT, BURNBIT, COALSMOKE1, COALSMOKE2, COALSMOKE3, COALSMOKE4, CONDBIT, map, Position::posX, Position::posY, and PWRBIT.
Referenced by doSpecialZone().
|
private |
Collect taxes
Function seems to be doing different things depending on Micropolis::totalPop value. With an non-empty city it does fund calculations. For an empty city, it immediately sets effects of funding, which seems inconsistent at least, and may be wrong
If Micropolis::taxFlag is set, no variable is touched which seems non-robust at least
Definition at line 856 of file simulate.cpp.
References cityTax, doBudget(), fireEffect, fireFund, fireStationPop, gameLevel, landValueAverage, LENGTH_OF, LEVEL_COUNT, MAX_FIRE_STATION_EFFECT, MAX_POLICE_STATION_EFFECT, MAX_ROAD_EFFECT, policeEffect, policeFund, policeStationPop, railTotal, roadEffect, roadFund, roadTotal, taxFlag, taxFund, and totalPop.
|
private |
Build a commercial zone.
pos | Position of the commercial zone. |
Den | Density |
Value | Land value corrected for pollution. |
Definition at line 883 of file zone.cpp.
References zonePlop().
Referenced by doComIn(), and doComOut().
void Micropolis::computeComRateMap | ( | ) |
Compute distance to city center for the entire map.
Definition at line 585 of file scan.cpp.
References comRateMap, getCityCenterDistance(), Map< DATA, BLKSIZE >::MAP_H, Map< DATA, BLKSIZE >::MAP_W, and Map< DATA, BLKSIZE >::set().
Referenced by populationDensityScan().
|
private |
Perform the command, and fix wire/road/rail/zone connections around it. Store modification in the effects object.
x | X world position to perform the command. |
y | Y world position to perform the command. |
cmd | Command to perform. |
effects | Modification collecting object. |
Definition at line 133 of file connect.cpp.
References ToolEffects::addCost(), autoBulldoze, BULLBIT, CONNECT_TILE_BULLDOZE, CONNECT_TILE_FIX, CONNECT_TILE_RAILROAD, CONNECT_TILE_ROAD, CONNECT_TILE_WIRE, DIRT, fixZone(), ToolEffects::getMapValue(), HBRIDGE, layDoze(), layRail(), layRoad(), layWire(), LOMASK, neutralizeRoad(), NOT_REACHED, ToolEffects::setMapValue(), testBounds(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by bulldozerTool(), checkBorder(), railroadTool(), roadTool(), and wireTool().
int Micropolis::countProblems | ( | ) |
Return number of problem in the city.
Definition at line 528 of file evaluate.cpp.
References CVP_NUMPROBLEMS, CVP_PROBLEM_COMPLAINTS, and problemOrder.
void Micropolis::crimeScan | ( | ) |
Smooth police station map and compute crime rate
Definition at line 413 of file scan.cpp.
References clamp(), crimeAverage, crimeMaxX, crimeMaxY, crimeRateMap, getRandom16(), landValueMap, Map< DATA, BLKSIZE >::MAP_BLOCKSIZE, MAP_TYPE_CRIME, MAP_TYPE_DYNAMIC, MAP_TYPE_POLICE_RADIUS, min(), newMapFlags, policeStationEffectMap, policeStationMap, populationDensityMap, smoothStationMap(), WORLD_H, WORLD_W, Map< DATA, BLKSIZE >::worldGet(), and Map< DATA, BLKSIZE >::worldSet().
Referenced by doSimInit().
int Micropolis::currentYear | ( | ) |
Get the current year.
Definition at line 297 of file utilities.cpp.
References cityTime, and startingYear.
|
private |
Decrease rate of grow.
Definition at line 371 of file simulate.cpp.
References clamp(), Map< DATA, BLKSIZE >::get(), Map< DATA, BLKSIZE >::MAP_H, Map< DATA, BLKSIZE >::MAP_W, rateOfGrowthMap, and Map< DATA, BLKSIZE >::set().
|
private |
Decrease traffic memory
Definition at line 339 of file simulate.cpp.
References Map< DATA, BLKSIZE >::MAP_BLOCKSIZE, trafficDensityMap, WORLD_H, WORLD_W, Map< DATA, BLKSIZE >::worldGet(), and Map< DATA, BLKSIZE >::worldSet().
|
private |
Definition at line 680 of file micropolis.cpp.
void Micropolis::destroyAllSprites | ( | ) |
Destroy all sprites by de-activating them all (setting their SimSprite::frame to 0).
Definition at line 298 of file sprite.cpp.
References SimSprite::frame, SimSprite::next, and spriteList.
Referenced by initWillStuff().
|
private |
Free all map arrays
Definition at line 121 of file allocate.cpp.
References Map< DATA, BLKSIZE >::clear(), comHist, crimeHist, crimeRateMap, freePtr(), indHist, landValueMap, map, mapBase, miscHist, moneyHist, pollutionDensityMap, pollutionHist, populationDensityMap, resHist, tempMap1, tempMap2, tempMap3, terrainDensityMap, trafficDensityMap, and WORLD_W.
void Micropolis::destroyMapTile | ( | int | ox, |
int | oy | ||
) |
Destroy a map tile.
ox | X coordinate in pixels. |
oy | Y coordinate in pixels. |
Definition at line 1714 of file sprite.cpp.
References ANIMBIT, BULLBIT, BURNBIT, doAnimation, LOMASK, makeExplosionAt(), map, startFireInZone(), testBounds(), and ZONEBIT.
Referenced by doMonsterSprite(), doShipSprite(), and doTornadoSprite().
void Micropolis::destroySprite | ( | SimSprite * | sprite | ) |
Destroy the sprite by taking it out of the active list.
sprite | Sprite to destroy. |
Definition at line 313 of file sprite.cpp.
References freeSprites, SimSprite::next, spriteList, and SimSprite::type.
Referenced by moveObjects().
void Micropolis::didLoadCity | ( | const std::string & | filename | ) |
Report to the frontend that the game was successfully loaded.
Definition at line 568 of file fileio.cpp.
References callback.
Referenced by loadCity().
void Micropolis::didLoadScenario | ( | int | s, |
const std::string | name, | ||
const std::string | fname | ||
) |
Report to the front-end that the scenario was loaded.
Definition at line 522 of file fileio.cpp.
References callback.
Referenced by loadScenario().
void Micropolis::didntLoadCity | ( | const std::string & | filename | ) |
Report to the frontend that the game failed to load.
msg | File that attempted to load |
Definition at line 578 of file fileio.cpp.
References callback.
Referenced by loadCity().
void Micropolis::didntSaveCity | ( | const std::string & | filename | ) |
Report to the frontend that the city could not be saved.
filename | Name of the file used |
Definition at line 633 of file fileio.cpp.
References callback.
Referenced by saveCity(), and saveCityAs().
void Micropolis::didSaveCity | ( | const std::string & | filename | ) |
Report to the frontend that the city was saved successfully.
filename | Name of the file used |
Definition at line 623 of file fileio.cpp.
References callback.
Referenced by saveCity(), and saveCityAs().
void Micropolis::didTool | ( | std::string | name, |
short | x, | ||
short | y | ||
) |
Report to the front-end that a tool was used.
name | Name of the tool. |
x | X coordinate of where the tool was applied. |
y | Y coordinate of where the tool was applied. |
Definition at line 947 of file tool.cpp.
References callback.
Referenced by bulldozerTool(), queryTool(), and FrontendMessageDidTool::sendMessage().
void Micropolis::doAirplaneSprite | ( | SimSprite * | sprite | ) |
Move airplane sprite.
sprite | Airplane sprite. |
Remove local magic constants and document the code.
absDist gets updated by Micropolis::getDir(), which is not always called before reading it (or worse, we just turned towards the old destination).
Definition at line 800 of file sprite.cpp.
References checkSpriteCollision(), SimSprite::destX, SimSprite::destY, enableDisasters, explodeSprite(), SimSprite::frame, getDir(), getRandom(), SimSprite::next, SPRITE_AIRPLANE, SPRITE_HELICOPTER, spriteList, spriteNotInBounds(), turnTo(), SimSprite::type, WORLD_H, WORLD_W, SimSprite::x, and SimSprite::y.
Referenced by moveObjects().
|
private |
Generate a airplane or helicopter every now and then.
pos | Position of the airport to start from. |
Definition at line 1651 of file simulate.cpp.
References generateCopter(), generatePlane(), and getRandom().
Referenced by doSpecialZone().
void Micropolis::doAutoGoto | ( | short | x, |
short | y, | ||
const std::string & | message | ||
) |
Tell the front-end that it should perform an auto-goto
x | X position at the map |
y | Y position at the map |
message | Message |
Definition at line 457 of file message.cpp.
References callback.
Handle a bridge.
pos | Position of the bridge. |
tile | Tile value of the bridge. |
What does this function return?
Discover the structure of all the magic constants.
Definition at line 1145 of file simulate.cpp.
References BULLBIT, getBoatDistance(), getRandom16(), HBRIDGE, LOMASK, map, Position::posX, Position::posY, testBounds(), VBRIDGE, and WORLD_W.
Referenced by doRoad().
|
private |
Make a big river.
pos | Start position of making a river. |
riverDir | Global direction of the river. |
terrainDir | Local direction of the terrain. |
Definition at line 512 of file generate.cpp.
References getRandom(), Position::move(), plopBRiver(), Position::posX, Position::posY, rotate45(), terrainCurveLevel, and testBounds().
Referenced by doRivers().
void Micropolis::doBudget | ( | ) |
Game decided to show the budget window
Definition at line 97 of file budget.cpp.
References doBudgetNow().
Referenced by collectTax().
void Micropolis::doBudgetFromMenu | ( | ) |
void Micropolis::doBudgetNow | ( | bool | fromMenu | ) |
Handle budget window.
fromMenu | User requested the budget window. |
Definition at line 116 of file budget.cpp.
References autoBudget, fireFund, firePercent, fireSpend, fireValue, MESSAGE_NO_MONEY, mustDrawBudget, mustUpdateOptions, NOWHERE, policeFund, policePercent, policeSpend, policeValue, roadFund, roadPercent, roadSpend, roadValue, sendMessage(), setAutoBudget(), spend(), taxFund, and totalFunds.
Referenced by doBudget(), and doBudgetFromMenu().
void Micropolis::doBusSprite | ( | SimSprite * | sprite | ) |
Move bus sprite.
sprite | Bus sprite. |
Definition at line 1342 of file sprite.cpp.
References canDriveOn(), checkSpriteCollision(), clamp(), enableDisasters, explodeSprite(), SimSprite::frame, SimSprite::next, SPRITE_BUS, SPRITE_TRAIN, spriteList, trafficDensityMap, SimSprite::type, WORLD_H, WORLD_H_2, WORLD_W, Map< DATA, BLKSIZE >::worldGet(), SimSprite::x, SimSprite::xHot, SimSprite::y, and SimSprite::yHot.
Referenced by moveObjects().
|
private |
Handle immigration of commercial zone.
pos | Position of the commercial zone. |
pop | Population ? |
value | Land value corrected for pollution. |
Definition at line 823 of file zone.cpp.
References comPlop(), incRateOfGrowth(), landValueMap, Position::posX, Position::posY, and Map< DATA, BLKSIZE >::worldGet().
Referenced by doCommercial().
|
private |
Handle commercial zone.
pos | Position of the commercial zone. |
zonePwrFlg | Does the zone have power? |
Definition at line 765 of file zone.cpp.
References comPop, comZonePop, doComIn(), doComOut(), evalCom(), getComZonePop(), getLandPollutionValue(), getRandom(), getRandom16(), getRandom16Signed(), LOMASK, makeTraffic(), map, Position::posX, Position::posY, and ZT_INDUSTRIAL.
Referenced by doZone().
|
private |
Handle emigration of commercial zone.
pos | Position of the commercial zone. |
pop | Population ? |
value | Land value corrected for pollution. |
Definition at line 846 of file zone.cpp.
References comPlop(), incRateOfGrowth(), and zonePlop().
Referenced by doCommercial().
void Micropolis::doCopterSprite | ( | SimSprite * | sprite | ) |
Move helicopter sprite.
sprite | Helicopter sprite. |
Definition at line 695 of file sprite.cpp.
References SimSprite::destX, SimSprite::destY, SimSprite::frame, getDir(), getRandom16(), getSprite(), makeSound(), MESSAGE_HEAVY_TRAFFIC, sendMessage(), SPRITE_MONSTER, SPRITE_TORNADO, trafficDensityMap, turnTo(), WORLD_H, Map< DATA, BLKSIZE >::worldGet(), SimSprite::x, and SimSprite::y.
Referenced by moveObjects().
|
private |
Let disasters happen.
DisChance
table). Definition at line 92 of file disasters.cpp.
References disasterEvent, enableDisasters, floodCount, gameLevel, getRandom(), LENGTH_OF, LEVEL_COUNT, LEVEL_EASY, LEVEL_LAST, makeEarthquake(), makeFlood(), makeMonster(), makeTornado(), pollutionAverage, SC_NONE, scenarioDisaster(), and setFire().
void Micropolis::doEarthquake | ( | int | strength | ) |
Tell the front-end to show an earthquake to the user (shaking the map for some time).
Definition at line 1114 of file micropolis.cpp.
References callback, and makeSound().
Referenced by makeEarthquake().
void Micropolis::doExplosionSprite | ( | SimSprite * | sprite | ) |
'Move' fire sprite.
sprite | Fire sprite. |
Definition at line 1306 of file sprite.cpp.
References SimSprite::frame, makeSound(), MESSAGE_EXPLOSION_REPORTED, sendMessage(), startFire(), SimSprite::x, and SimSprite::y.
Referenced by moveObjects().
|
private |
Handle tile being on fire.
pos | Position of the fire. |
Needs a notion of iterative neighbour tiles computing.
Use a getFromMap()-like function here.
Extract constants of fire station effectiveness from here.
Definition at line 1300 of file simulate.cpp.
References BURNBIT, fireStationEffectMap, fireZone(), getRandom(), getRandom16(), IZB, LOMASK, makeExplosionAt(), map, Position::posX, Position::posY, randomFire(), randomRubble(), testBounds(), Map< DATA, BLKSIZE >::worldGet(), and ZONEBIT.
|
private |
Flood around the given position.
pos | Position around which to flood further. |
Definition at line 385 of file disasters.cpp.
References BURNBIT, DIRT, fireZone(), floodCount, getRandom(), getRandom16(), LOMASK, map, Position::posX, Position::posY, testBounds(), and ZONEBIT.
|
private |
Count the number of single tile houses in a residential zone.
pos | Position of the residential zone. |
Definition at line 409 of file zone.cpp.
References LOMASK, map, Position::posX, Position::posY, and WORLD_H.
Referenced by doResidential(), and getPopulationDensity().
|
private |
Handle repairing or removing of hospitals and churches.
pos | Position of the hospital or church. |
Definition at line 147 of file zone.cpp.
References callback, churchPop, cityTime, getRandom(), hospitalPop, LOMASK, map, needChurch, needHospital, Position::posX, Position::posY, repairZone(), and zonePlop().
Referenced by doZone().
|
private |
Handle immigration of industrial zone.
pos | Position of the center tile of the industrial tile. |
pos | Population value of the industrial zone. |
value | Random land value (it seems). |
Definition at line 967 of file zone.cpp.
References incRateOfGrowth(), and indPlop().
Referenced by doIndustrial().
|
private |
Handle industrial zone emigration.
pos | Position of the center tile of the industrial tile. |
pos | Population value of the industrial zone. |
value | Random land value (it seems). |
Definition at line 981 of file zone.cpp.
References incRateOfGrowth(), INDBASE, indPlop(), and zonePlop().
Referenced by doIndustrial().
|
private |
Handle industrial zone.
pos | Position of the industrial zone. |
zonePwrFlg | Does the zone have power? |
Definition at line 917 of file zone.cpp.
References doIndIn(), doIndOut(), evalInd(), getIndZonePop(), getRandom(), getRandom16(), getRandom16Signed(), indPop, indZonePop, LOMASK, makeTraffic(), map, Position::posX, Position::posY, setSmoke(), and ZT_RESIDENTIAL.
Referenced by doZone().
void Micropolis::doLoseGame | ( | ) |
Tell the front-end that the player has lost the game
Definition at line 464 of file message.cpp.
References callback.
Referenced by doScenarioScore().
void Micropolis::doMakeSound | ( | int | mesgNum, |
int | x, | ||
int | y | ||
) |
Make a sound for message mesgNum if appropriate.
mesgNum | Message number displayed. |
x | Horizontal coordinate in the city of the sound. |
y | Vertical coordinate in the city of the sound. |
Definition at line 402 of file message.cpp.
References getRandom(), makeSound(), MESSAGE_EARTHQUAKE, MESSAGE_FIRE_REPORTED, MESSAGE_FIREBOMBING, MESSAGE_HELICOPTER_CRASHED, MESSAGE_HIGH_CRIME, MESSAGE_MONSTER_SIGHTED, MESSAGE_NUCLEAR_MELTDOWN, MESSAGE_PLANE_CRASHED, MESSAGE_RIOTS_REPORTED, MESSAGE_SHIP_CRASHED, MESSAGE_TORNADO_SIGHTED, MESSAGE_TRAFFIC_JAMS, and MESSAGE_TRAIN_CRASHED.
|
private |
Perform a nuclear melt-down disaster
pos | Position of the nuclear power plant that melts. |
Definition at line 1688 of file simulate.cpp.
References BURNBIT, DIRT, getRandom(), makeExplosion(), map, MESSAGE_NUCLEAR_MELTDOWN, Position::posX, Position::posY, RADTILE, randomFire(), sendMessage(), testBounds(), and ZONEBIT.
Referenced by doSpecialZone(), and makeMeltdown().
void Micropolis::doMonsterSprite | ( | SimSprite * | sprite | ) |
Move monster sprite.
There are 16 monster sprite frames:
Frame 0: NorthEast Left Foot Frame 1: NorthEast Both Feet Frame 2: NorthEast Right Foot Frame 3: SouthEast Right Foot Frame 4: SouthEast Both Feet Frame 5: SouthEast Left Foot Frame 6: SouthWest Right Foot Frame 7: SouthWest Both Feet Frame 8: SouthWest Left Foot Frame 9: NorthWest Left Foot Frame 10: NorthWest Both Feet Frame 11: NorthWest Right Foot Frame 12: North Left Foot Frame 13: East Left Foot Frame 14: South Right Foot Frame 15: West Right Foot
sprite | Monster sprite. |
Definition at line 1007 of file sprite.cpp.
References checkSpriteCollision(), destroyMapTile(), SimSprite::destX, SimSprite::destY, explodeSprite(), SimSprite::frame, getChar(), getDir(), getRandom(), getRandom16(), makeSound(), SimSprite::next, SPRITE_AIRPLANE, SPRITE_HELICOPTER, SPRITE_SHIP, SPRITE_TRAIN, spriteList, SimSprite::type, SimSprite::x, SimSprite::xHot, SimSprite::y, and SimSprite::yHot.
Referenced by moveObjects().
void Micropolis::doNewGame | ( | ) |
Notify the user interface to start a new game.
Definition at line 306 of file utilities.cpp.
References callback.
Referenced by initWillStuff().
|
private |
Copy bits from powerGridMap to the PWRBIT in the map for all zones in the world.
Definition at line 323 of file simulate.cpp.
References map, setZonePower(), WORLD_H, WORLD_W, and ZONEBIT.
Referenced by simLoadInit().
|
private |
Compute city population and city classification.
Definition at line 182 of file evaluate.cpp.
References cityClass, cityPop, cityPopDelta, getCityClass(), and getPopulation().
Referenced by cityEvaluation().
|
private |
Scan the map for powered tiles, and copy them to the Micropolis::powerGridMap array. Also warns the user about using too much power ('buy another power plant').
Definition at line 125 of file power.cpp.
References Map< DATA, BLKSIZE >::clear(), COAL_POWER_STRENGTH, coalPowerPop, DIR2_BEGIN, DIR2_END, DIR2_INVALID, increment90(), MESSAGE_NOT_ENOUGH_POWER, Position::move(), NUCLEAR_POWER_STRENGTH, nuclearPowerPop, Position::posX, Position::posY, powerGridMap, powerStackPointer, pullPowerStack(), pushPowerStack(), sendMessage(), testForConductive(), and Map< DATA, BLKSIZE >::worldSet().
Referenced by doSimInit().
|
private |
Evaluate problems of the city, take votes, and decide which are the most important ones.
problemTable | Storage of how bad each problem is. |
Definition at line 241 of file evaluate.cpp.
References cityTax, crimeAverage, CVP_CRIME, CVP_FIRE, CVP_HOUSING, CVP_NUMPROBLEMS, CVP_POLLUTION, CVP_PROBLEM_COMPLAINTS, CVP_TAXES, CVP_TRAFFIC, CVP_UNEMPLOYMENT, getFireSeverity(), getTrafficAverage(), getUnemployment(), landValueAverage, pollutionAverage, problemOrder, problemVotes, and voteProblems().
Referenced by cityEvaluation().
|
private |
Handle decay of radio-active tile
pos | Position of the radio-active tile. |
Definition at line 1060 of file simulate.cpp.
References DIRT, getRandom16(), map, Position::posX, and Position::posY.
|
private |
Handle rail track. Generate a train, and handle road deteriorating effects.
pos | Position of the rail. |
Definition at line 1025 of file simulate.cpp.
References CONDBIT, generateTrain(), getRandom16(), LOMASK, map, MAX_ROAD_EFFECT, Position::posX, Position::posY, railTotal, randomRubble(), and roadEffect.
|
private |
Handle residential zone.
pos | Center tile of the residential zone. |
zonePwrFlg | Does the zone have power? |
Definition at line 548 of file zone.cpp.
References doFreePop(), doResIn(), doResOut(), evalRes(), getLandPollutionValue(), getRandom(), getRandom16(), getRandom16Signed(), getResZonePop(), LOMASK, makeHospital(), makeTraffic(), map, Position::posX, Position::posY, resPop, resZonePop, and ZT_COMMERCIAL.
Referenced by doZone().
|
private |
Perform residential immigration into the current residential tile.
pos | Position of the tile. |
pop | Population ? |
value | Land value corrected for pollution. |
Definition at line 614 of file zone.cpp.
References buildHouse(), incRateOfGrowth(), LOMASK, map, pollutionDensityMap, populationDensityMap, Position::posX, Position::posY, resPlop(), and Map< DATA, BLKSIZE >::worldGet().
Referenced by doResidential().
|
private |
Perform residential emigration from the current residential tile.
pos | Position of the tile. |
pop | Population ? |
value | Land value corrected for pollution. |
Definition at line 655 of file zone.cpp.
References getRandom(), incRateOfGrowth(), LOMASK, map, Position::posX, Position::posY, resPlop(), testBounds(), and ZONEBIT.
Referenced by doResidential().
|
private |
Construct rivers.
terrainPos | Coordinate to start making a river. |
Definition at line 489 of file generate.cpp.
References DIR2_NORTH, doBRiver(), doSRiver(), getRandom(), and rotate180().
Referenced by generateMap().
|
private |
Handle road tile.
pos | Position of the road. |
Definition at line 1072 of file simulate.cpp.
References ALLBITS, ANIMBIT, BURNBIT, CONDBIT, doBridge(), getRandom16(), HTRFBASE, LOMASK, LTRFBASE, map, MAX_ROAD_EFFECT, Position::posX, Position::posY, randomRubble(), roadEffect, roadTotal, trafficDensityMap, and Map< DATA, BLKSIZE >::worldGet().
void Micropolis::doSaveCityAs | ( | const std::string & | filename | ) |
Report to the frontend that the city is being saved.
filename | Name of the file used |
Definition at line 613 of file fileio.cpp.
References callback.
Referenced by saveCity().
void Micropolis::doScenarioScore | ( | Scenario | type | ) |
Compute score for each scenario
type | Scenario used |
SC_NONE
Definition at line 313 of file message.cpp.
References CC_METROPOLIS, cityClass, cityScore, crimeAverage, doLoseGame(), MESSAGE_SCENARIO_LOST, MESSAGE_SCENARIO_WON, NOT_REACHED, NOWHERE, SC_BERN, SC_BOSTON, SC_DETROIT, SC_DULLSVILLE, SC_HAMBURG, SC_RIO, SC_SAN_FRANCISCO, SC_TOKYO, sendMessage(), and trafficAverage.
Referenced by sendMessages().
void Micropolis::doScoreCard | ( | ) |
Push new score to the user
Definition at line 479 of file evaluate.cpp.
References callback.
Referenced by scoreDoer().
void Micropolis::doShipSprite | ( | SimSprite * | sprite | ) |
Move ship sprite.
sprite | Ship sprite. |
Definition at line 867 of file sprite.cpp.
References destroyMapTile(), explodeSprite(), SimSprite::frame, getRandom(), getRandom16(), LOMASK, makeSound(), map, SC_SAN_FRANCISCO, scenario, spriteNotInBounds(), testBounds(), tryOther(), turnTo(), SimSprite::x, and SimSprite::y.
Referenced by moveObjects().
|
private |
Tell front-end to report on status of a tile.
tileCategoryIndex | Category of the tile text index. |
populationDensityIndex | Population density text index. |
landValueIndex | Land value text index. |
crimeRateIndex | Crime rate text index. |
pollutionIndex | Pollution text index. |
growthRateIndex | Grow rate text index. |
x | X coordinate of the tile. |
y | Y coordinate of the tile. |
Definition at line 903 of file tool.cpp.
References callback.
Referenced by doZoneStatus().
|
private |
Initialize simulation.
Definition at line 288 of file simulate.cpp.
References censusChanged, crimeScan(), doInitialEval, doPowerScan(), fireAnalysis(), newMap, populationDensityScan(), setValves(), simLoadInit(), totalPop, and WORLD_W.
Referenced by generateSomeCity(), init(), loadCity(), loadFile(), and loadScenario().
|
private |
Update special zones.
pos | Position of the zone. |
powerOn | Zone is powered. |
Definition at line 1451 of file simulate.cpp.
References airportPop, ANIMBIT, BURNBIT, cityTime, coalPowerPop, coalSmoke(), CONDBIT, doAirport(), doMeltdown(), drawStadium(), enableDisasters, findPerimeterRoad(), fireEffect, FIRESTATION, fireStationMap, fireStationPop, gameLevel, generateShip(), getRandom(), getSprite(), LENGTH_OF, LEVEL_COUNT, LOMASK, map, NUCLEAR, nuclearPowerPop, policeEffect, policeStationMap, policeStationPop, PORT, Position::posX, Position::posY, POWERPLANT, pushPowerStack(), repairZone(), seaportPop, SPRITE_SHIP, STADIUM, stadiumPop, Map< DATA, BLKSIZE >::worldGet(), and Map< DATA, BLKSIZE >::worldSet().
Referenced by doZone().
|
private |
Make a small river.
pos | Start position of making a river. |
riverDir | Global direction of the river. |
terrainDir | Local direction of the terrain. |
Definition at line 552 of file generate.cpp.
References getRandom(), Position::move(), plopSRiver(), Position::posX, Position::posY, rotate45(), terrainCurveLevel, and testBounds().
Referenced by doRivers().
void Micropolis::doStartGame | ( | ) |
Tell the front-end a game is started.
Definition at line 1104 of file micropolis.cpp.
References callback.
Referenced by simLoadInit().
void Micropolis::doStartScenario | ( | int | scenario | ) |
Tell the front-end a scenario is started.
scenario | The scenario being started. |
Definition at line 1095 of file micropolis.cpp.
References callback, and scenario.
Referenced by simLoadInit().
void Micropolis::doTimeStuff | ( | ) |
Definition at line 150 of file update.cpp.
ToolResult Micropolis::doTool | ( | EditingTool | tool, |
short | tileX, | ||
short | tileY | ||
) |
Apply a tool.
tool | Tool to use. |
tileX | Horizontal position in the city map. |
tileY | Vertical position in the city map. |
Definition at line 1397 of file tool.cpp.
References airportBuilding, buildBuildingTool(), coalPowerBuilding, commercialZoneBuilding, fireStationBuilding, forestTool(), industrialZoneBuilding, landTool(), ToolEffects::modifyIfEnoughFunding(), networkTool(), nuclearPowerBuilding, parkTool(), policeStationBuilding, queryTool(), railroadTool(), residentialZoneBuilding, roadTool(), seaportBuilding, stadiumBuilding, TOOLRESULT_FAILED, TOOLRESULT_NO_MONEY, TOOLRESULT_OK, and wireTool().
Referenced by toolDown(), and toolDrag().
void Micropolis::doTornadoSprite | ( | SimSprite * | sprite | ) |
Move tornado.
sprite | Tornado sprite to move. |
Definition at line 1239 of file sprite.cpp.
References checkSpriteCollision(), destroyMapTile(), explodeSprite(), SimSprite::frame, getRandom(), SimSprite::next, SPRITE_AIRPLANE, SPRITE_HELICOPTER, SPRITE_SHIP, SPRITE_TRAIN, spriteList, spriteNotInBounds(), SimSprite::type, SimSprite::x, and SimSprite::y.
Referenced by moveObjects().
void Micropolis::doTrainSprite | ( | SimSprite * | sprite | ) |
Move train sprite.
sprite | Train sprite. |
Definition at line 623 of file sprite.cpp.
References SimSprite::frame, getChar(), getRandom16(), RAILHPOWERV, RAILVPOWERH, SimSprite::x, and SimSprite::y.
Referenced by moveObjects().
|
private |
Splash trees around the world.
Definition at line 340 of file generate.cpp.
References getRandom(), terrainTreeLevel, treeSplash(), WORLD_H, and WORLD_W.
Referenced by generateMap(), and makeIsland().
void Micropolis::doUpdateHeads | ( | ) |
Definition at line 88 of file update.cpp.
|
private |
Vote whether the mayor is doing a good job
Definition at line 464 of file evaluate.cpp.
References cityScore, cityYes, and getRandom().
Referenced by cityEvaluation().
void Micropolis::doWinGame | ( | ) |
Tell the front-end that the player has won the game
Definition at line 471 of file message.cpp.
References callback.
|
private |
Handle zone.
pos | Position of the zone. |
Definition at line 91 of file zone.cpp.
References doCommercial(), doHospitalChurch(), doIndustrial(), doResidential(), doSpecialZone(), INDBASE, LOMASK, map, PORTBASE, Position::posX, Position::posY, poweredZoneCount, setZonePower(), and unpoweredZoneCount.
|
private |
Report about the status of a tile.
mapH | X coordinate of the tile. |
mapV | Y coordinate of the tile. |
Definition at line 838 of file tool.cpp.
References clamp(), COALBASE, COALSMOKE1, doShowZoneStatus(), getDensity(), LOMASK, and map.
Referenced by queryTool().
void Micropolis::drawMonth | ( | short * | hist, |
unsigned char * | s, | ||
float | scale | ||
) |
Draw a stadium (either full or empty).
center | Center tile position of the stadium. |
z | Base tile value. |
Definition at line 1630 of file simulate.cpp.
References map, Position::posX, Position::posY, PWRBIT, and ZONEBIT.
Referenced by doSpecialZone().
void Micropolis::drawValve | ( | ) |
Definition at line 195 of file update.cpp.
Has the journey arrived at its destination?
pos | Current position. |
destZone | Zonetype to drive to. |
Definition at line 453 of file traffic.cpp.
References LENGTH_OF, LOMASK, map, NUCLEAR, PORT, Position::posX, Position::posY, WORLD_H, WORLD_W, and ZT_NUM_DESTINATIONS.
Referenced by tryDrive().
|
private |
Compute evaluation of a commercial zone.
traf | Result if traffic attempt. |
Definition at line 897 of file zone.cpp.
References comRateMap, Position::posX, Position::posY, and Map< DATA, BLKSIZE >::worldGet().
Referenced by doCommercial().
|
private |
Compute evaluation of an industrial zone.
traf | Result if traffic attempt. |
Definition at line 1029 of file zone.cpp.
Referenced by doIndustrial().
void Micropolis::evalInit | ( | ) |
Initialize evaluation variables
Definition at line 136 of file evaluate.cpp.
References CC_VILLAGE, cityAssessedValue, cityClass, cityPop, cityPopDelta, cityScore, cityScoreDelta, cityYes, CVP_NUMPROBLEMS, CVP_PROBLEM_COMPLAINTS, problemOrder, and problemVotes.
Referenced by cityEvaluation().
|
private |
Evaluate suitability of the position for placing a new house.
Definition at line 514 of file zone.cpp.
References DIRT, LOMASK, map, and testBounds().
Referenced by buildHouse().
|
private |
Evaluate residential zone.
Definition at line 736 of file zone.cpp.
References landValueMap, min(), pollutionDensityMap, Position::posX, Position::posY, and Map< DATA, BLKSIZE >::worldGet().
Referenced by doResidential().
void Micropolis::explodeSprite | ( | SimSprite * | sprite | ) |
Handle explosion of sprite (mostly due to collision?).
sprite | that should explode. |
Definition at line 1654 of file sprite.cpp.
References SimSprite::frame, makeExplosionAt(), makeSound(), MESSAGE_HELICOPTER_CRASHED, MESSAGE_PLANE_CRASHED, MESSAGE_SHIP_CRASHED, MESSAGE_TRAIN_CRASHED, sendMessage(), SPRITE_AIRPLANE, SPRITE_BUS, SPRITE_HELICOPTER, SPRITE_SHIP, SPRITE_TRAIN, SimSprite::type, SimSprite::x, SimSprite::xHot, SimSprite::y, and SimSprite::yHot.
Referenced by doAirplaneSprite(), doBusSprite(), doMonsterSprite(), doShipSprite(), and doTornadoSprite().
|
private |
Find a connection to a road at the perimeter.
pos | Starting position. Gets updated when a perimeter has been found. |
Definition at line 239 of file traffic.cpp.
References map, Position::posX, Position::posY, roadTest(), and testBounds().
Referenced by doSpecialZone(), and makeTraffic().
|
private |
Find a telecom connection at the perimeter.
pos | Position to start searching. |
Definition at line 274 of file traffic.cpp.
References LOMASK, map, Position::posX, and testBounds().
Referenced by makeTraffic().
void Micropolis::fireAnalysis | ( | ) |
Make firerate map from firestation map.
Definition at line 120 of file scan.cpp.
References fireStationEffectMap, fireStationMap, MAP_TYPE_DYNAMIC, MAP_TYPE_FIRE_RADIUS, newMapFlags, and smoothStationMap().
Referenced by doSimInit().
void Micropolis::fireBomb | ( | ) |
Let a fire bomb explode at a random location
Definition at line 233 of file disasters.cpp.
References getRandom(), makeExplosion(), MESSAGE_FIREBOMBING, sendMessage(), WORLD_H, and WORLD_W.
Referenced by makeFireBombs().
Handle a zone on fire.
Decreases rate of growth of the zone, and makes remaining tiles bulldozable.
pos | Position of the zone on fire. |
ch | Character of the zone. |
Definition at line 1363 of file simulate.cpp.
References BULLBIT, clamp(), LOMASK, map, PORTBASE, Position::posX, Position::posY, rateOfGrowthMap, testBounds(), Map< DATA, BLKSIZE >::worldGet(), and Map< DATA, BLKSIZE >::worldSet().
|
private |
Modify road, rails, and wire connections at a given tile.
x | X map coordinate. |
y | Y map coordinate. |
effects | Modification collecting object. |
Definition at line 593 of file connect.cpp.
References BULLBIT, BURNBIT, CONDBIT, ToolEffects::getMapTile(), ToolEffects::getMapValue(), LOMASK, neutralizeRoad(), RAILHPOWERV, RAILVPOWERH, ToolEffects::setMapValue(), VBRIDGE, WORLD_H, and WORLD_W.
Referenced by fixZone().
|
private |
Update connections (rails, and wire connections) to a zone.
x | X map coordinate |
y | Y map coordinate. |
effects | Modification collecting object. |
Definition at line 565 of file connect.cpp.
References fixSingle(), WORLD_H, and WORLD_W.
Referenced by connectTile().
|
private |
Definition at line 1351 of file tool.cpp.
References ToolEffects::addFrontendMessage(), DIRT, ToolEffects::getMapValue(), LOMASK, putDownForest(), testBounds(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by doTool().
void Micropolis::freePtr | ( | void * | data | ) |
Release claimed memory.
data | Pointer to previously claimed memory. |
Definition at line 1084 of file micropolis.cpp.
Referenced by destroyMapArrays().
void Micropolis::generateBus | ( | int | x, |
int | y | ||
) |
Try to start a new bus sprite at the given map tile.
x | X coordinate in map coordinate. |
y | Y coordinate in map coordinate. |
Definition at line 1849 of file sprite.cpp.
References getRandom(), getSprite(), makeSprite(), and SPRITE_BUS.
void Micropolis::generateCopter | ( | const Position & | pos | ) |
Ensure a helicopter sprite exists.
If it does not exist, create one at the given coordinates.
pos | Start position in map coordinates. |
Definition at line 1969 of file sprite.cpp.
References getSprite(), makeSprite(), Position::posX, Position::posY, and SPRITE_HELICOPTER.
Referenced by doAirport().
void Micropolis::generateMap | ( | int | seed | ) |
Generate a map.
seed | Initialization seed for the random generator. |
Definition at line 129 of file generate.cpp.
References clearMap(), doRivers(), doTrees(), generatedCitySeed, getRandom(), makeIsland(), makeLakes(), makeNakedIsland(), seedRandom(), terrainCreateIsland, terrainCurveLevel, terrainLakeLevel, terrainTreeLevel, WORLD_H, and WORLD_W.
Referenced by generateSomeCity().
void Micropolis::generatePlane | ( | const Position & | pos | ) |
Ensure an airplane sprite exists.
If it does not exist, create one at the given coordinates.
pos | Start position in map coordinates. |
Definition at line 1985 of file sprite.cpp.
References getSprite(), makeSprite(), Position::posX, Position::posY, and SPRITE_AIRPLANE.
Referenced by doAirport().
void Micropolis::generateShip | ( | ) |
Try to construct a new ship sprite
Definition at line 1858 of file sprite.cpp.
References getRandom16(), makeShipHere(), map, WORLD_H, and WORLD_W.
Referenced by doSpecialZone().
void Micropolis::generateSomeCity | ( | int | seed | ) |
Generate a map for a city.
seed | Random number generator initializing seed |
Definition at line 102 of file generate.cpp.
References callback, cityFileName, cityTime, doInitialEval, doSimInit(), generateMap(), initWillStuff(), invalidateMaps(), resetEditorState(), resetMapState(), SC_NONE, scenario, simUpdate(), and updateFunds().
Referenced by generateSomeRandomCity().
void Micropolis::generateSomeRandomCity | ( | ) |
Create a new map for a city.
Definition at line 92 of file generate.cpp.
References generateSomeCity(), and getRandom16().
void Micropolis::generateTrain | ( | int | x, |
int | y | ||
) |
Try to start a new train sprite at the given map tile.
x | X coordinate in map coordinate. |
y | Y coordinate in map coordinate. |
Definition at line 1836 of file sprite.cpp.
References getRandom(), getSprite(), makeSprite(), SPRITE_TRAIN, and totalPop.
Referenced by doRail().
|
private |
Assess value of the city.
Definition at line 159 of file evaluate.cpp.
References airportPop, cityAssessedValue, coalPowerPop, fireStationPop, hospitalPop, nuclearPowerPop, policeStationPop, railTotal, roadTotal, seaportPop, and stadiumPop.
Referenced by cityEvaluation().
|
private |
Compute distance to nearest boat from a given bridge.
pos | Position of bridge. |
Definition at line 1270 of file simulate.cpp.
References absoluteValue(), SimSprite::frame, min(), SimSprite::next, Position::posX, Position::posY, SPRITE_SHIP, spriteList, SimSprite::type, SimSprite::x, SimSprite::xHot, SimSprite::y, and SimSprite::yHot.
Referenced by doBridge().
short Micropolis::getChar | ( | int | x, |
int | y | ||
) |
Get character from the map.
x | X coordinate in pixels. |
y | Y coordinate in pixels. |
-1
if off-map. Definition at line 375 of file sprite.cpp.
References LOMASK, map, and testBounds().
Referenced by doMonsterSprite(), and doTrainSprite().
int Micropolis::getCityCenterDistance | ( | int | x, |
int | y | ||
) |
Compute Manhattan distance between given world position and center of the city.
x | X world coordinate of given position. |
y | Y world coordinate of given position. |
dx+dy
) between both positions. Definition at line 392 of file scan.cpp.
References cityCenterX, cityCenterY, and min().
Referenced by computeComRateMap().
|
private |
Classify the city based on its population.
cityPopulation | Number of people in the city. |
Definition at line 210 of file evaluate.cpp.
References CC_CAPITAL, CC_CITY, CC_MEGALOPOLIS, CC_METROPOLIS, CC_TOWN, and CC_VILLAGE.
Referenced by checkGrowth(), and doPopNum().
|
private |
Get commercial zone population number.
tile | Tile of the commercial zone. |
Definition at line 866 of file zone.cpp.
Referenced by doCommercial(), and getPopulationDensity().
int Micropolis::getCrimeRate | ( | int | x, |
int | y | ||
) |
Get a value from the crime rate map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
Definition at line 1403 of file micropolis.cpp.
References crimeRateMap, and Map< DATA, BLKSIZE >::get().
void * Micropolis::getCrimeRateMapBuffer | ( | ) |
Get the address of the internal buffer containing the crime rate map. This is used to enable the tile engine to access the crime rate map directly.
Definition at line 1429 of file micropolis.cpp.
References crimeRateMap, and Map< DATA, BLKSIZE >::getBase().
void Micropolis::getDemands | ( | float * | resDemandResult, |
float * | comDemandResult, | ||
float * | indDemandResult | ||
) |
Return the residential, commercial and industrial development demands, as floating point numbers from -1 (lowest demand) to 1 (highest demand).
Definition at line 424 of file utilities.cpp.
|
private |
Get string index for a status report on tile mapH, mapV on a given status category.
catNo | Category number: 0: population density 1: land value. 2: crime rate. 3: pollution. 4: growth rate. |
mapH | X coordinate of the tile. |
mapV | Y coordinate of the tile. |
Definition at line 788 of file tool.cpp.
References crimeRateMap, landValueMap, pollutionDensityMap, populationDensityMap, rateOfGrowthMap, STR202_CRIME_NONE, STR202_GROWRATE_DECLINING, STR202_GROWRATE_FASTGROWTH, STR202_GROWRATE_SLOWGROWTH, STR202_GROWRATE_STABLE, STR202_LANDVALUE_HIGH_CLASS, STR202_LANDVALUE_LOWER_CLASS, STR202_LANDVALUE_MIDDLE_CLASS, STR202_LANDVALUE_SLUM, STR202_POLLUTION_NONE, STR202_POPULATIONDENSITY_LOW, and Map< DATA, BLKSIZE >::worldGet().
Referenced by doZoneStatus().
short Micropolis::getDir | ( | int | orgX, |
int | orgY, | ||
int | desX, | ||
int | desY | ||
) |
Get direction (0..8?) to get from starting point to destination point.
orgX | X coordinate starting point. |
orgY | Y coordinate starting point. |
desX | X coordinate destination point. |
desY | Y coordinate destination point. |
Definition at line 477 of file sprite.cpp.
References absoluteValue().
Referenced by doAirplaneSprite(), doCopterSprite(), and doMonsterSprite().
int Micropolis::getDistance | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Compute Manhattan distance between two points.
x1 | X coordinate first point. |
y1 | Y coordinate first point. |
x2 | X coordinate second point. |
y2 | Y coordinate second point. |
Definition at line 525 of file sprite.cpp.
References absoluteValue().
Referenced by checkSpriteCollision().
short Micropolis::getERandom | ( | short | limit | ) |
Get a random number within a given range, with a preference to smaller values.
limit | Upper bound of the range (inclusive). |
0
and limit (inclusive). Definition at line 155 of file random.cpp.
References getRandom(), and min().
Referenced by makeNakedIsland().
int Micropolis::getFireCoverage | ( | int | x, |
int | y | ||
) |
Get a value from the fire coverage map.
x | X coordinate of the position to get, 0 to WORLD_W_8. |
y | Y coordinate of the position to get, 0 to WORLD_H_8. |
Definition at line 1483 of file micropolis.cpp.
References fireStationEffectMap, and Map< DATA, BLKSIZE >::get().
void * Micropolis::getFireCoverageMapBuffer | ( | ) |
Get the address of the internal buffer containing the fire coverage map. This is used to enable the tile engine to access the fire coverage map directly.
Definition at line 1509 of file micropolis.cpp.
References fireStationEffectMap, and Map< DATA, BLKSIZE >::getBase().
|
private |
Compute severity of fire
Definition at line 361 of file evaluate.cpp.
References firePop, and min().
Referenced by doProblems(), and getScore().
short Micropolis::getHistory | ( | int | historyType, |
int | historyScale, | ||
int | historyIndex | ||
) |
Get a value from the history tables.
historyType | Type of history information. |
historyScale | Scale of history data. |
historyIndex | Index in the data to obtain |
Definition at line 288 of file graph.cpp.
References comHist, crimeHist, HISTORY_COUNT, HISTORY_SCALE_COUNT, HISTORY_SCALE_LONG, HISTORY_SCALE_SHORT, HISTORY_TYPE_COM, HISTORY_TYPE_COUNT, HISTORY_TYPE_CRIME, HISTORY_TYPE_IND, HISTORY_TYPE_MONEY, HISTORY_TYPE_POLLUTION, HISTORY_TYPE_RES, indHist, moneyHist, NOT_REACHED, pollutionHist, and resHist.
void Micropolis::getHistoryRange | ( | int | historyType, |
int | historyScale, | ||
short * | minValResult, | ||
short * | maxValResult | ||
) |
Get the minimal and maximal values of a historic graph.
historyType | Type of history information. |
historyScale | Scale of history data. |
minValResult | Pointer to variable to write minimal value to. |
maxValResult | Pointer to variable to write maximal value to. |
Definition at line 218 of file graph.cpp.
References comHist, crimeHist, HISTORY_COUNT, HISTORY_SCALE_COUNT, HISTORY_SCALE_LONG, HISTORY_SCALE_SHORT, HISTORY_TYPE_COM, HISTORY_TYPE_COUNT, HISTORY_TYPE_CRIME, HISTORY_TYPE_IND, HISTORY_TYPE_MONEY, HISTORY_TYPE_POLLUTION, HISTORY_TYPE_RES, indHist, max(), min(), moneyHist, NOT_REACHED, pollutionHist, and resHist.
|
private |
Get the population value for the given industrial tile.
tile | Center tile value of the industrial zone. |
Definition at line 1001 of file zone.cpp.
Referenced by doIndustrial(), and getPopulationDensity().
|
private |
Compute land value at pos, taking pollution into account.
pos | Position of interest. |
0
=> low value, 3
=> high value) Definition at line 323 of file zone.cpp.
References landValueMap, pollutionDensityMap, Position::posX, Position::posY, and Map< DATA, BLKSIZE >::worldGet().
Referenced by doCommercial(), and doResidential().
int Micropolis::getLandValue | ( | int | x, |
int | y | ||
) |
Get a value from the land value map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
Definition at line 1443 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::get(), and landValueMap.
void * Micropolis::getLandValueMapBuffer | ( | ) |
Get the address of the internal buffer containing the land value map. This is used to enable the tile engine to access the land value map directly.
Definition at line 1469 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::getBase(), and landValueMap.
long Micropolis::getMapAddress | ( | ) |
Definition at line 1554 of file micropolis.cpp.
void * Micropolis::getMapBuffer | ( | ) |
Get the address of the internal buffer containing the map. This is used to enable the tile engine to access the tiles directly.
Definition at line 1189 of file micropolis.cpp.
References mapBase.
long Micropolis::getMapSize | ( | ) |
Definition at line 1560 of file micropolis.cpp.
long Micropolis::getMopAddress | ( | ) |
Definition at line 1566 of file micropolis.cpp.
long Micropolis::getMopSize | ( | ) |
Definition at line 1572 of file micropolis.cpp.
|
static |
Definition at line 234 of file animate.cpp.
int Micropolis::getPoliceCoverage | ( | int | x, |
int | y | ||
) |
Get a value from the police coverage map.
x | X coordinate of the position to get, 0 to WORLD_W_8. |
y | Y coordinate of the position to get, 0 to WORLD_H_8. |
Definition at line 1522 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::get(), and policeStationEffectMap.
void * Micropolis::getPoliceCoverageMapBuffer | ( | ) |
Get the address of the internal buffer containing the police coverage map. This is used to enable the tile engine to access the police coverage map directly.
Definition at line 1548 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::getBase(), and policeStationEffectMap.
int Micropolis::getPollutionDensity | ( | int | x, |
int | y | ||
) |
Get a value from the pollution density map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
Definition at line 1363 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::get(), and pollutionDensityMap.
void * Micropolis::getPollutionDensityMapBuffer | ( | ) |
Get the address of the internal buffer containing the pollution density map. This is used to enable the tile engine to access the pollution density map directly.
Definition at line 1389 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::getBase(), and pollutionDensityMap.
int Micropolis::getPollutionValue | ( | int | loc | ) |
|
private |
Compute city population.
Definition at line 197 of file evaluate.cpp.
References comPop, indPop, and resPop.
Referenced by checkGrowth(), and doPopNum().
Get population of a zone.
pos | Position of the zone to count. |
tile | Tile of the zone. |
Definition at line 198 of file scan.cpp.
References doFreePop(), getComZonePop(), getIndZonePop(), getResZonePop(), INDBASE, and PORTBASE.
Referenced by populationDensityScan().
int Micropolis::getPopulationDensity | ( | int | x, |
int | y | ||
) |
Get a value from the population density map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
Definition at line 1243 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::get(), and populationDensityMap.
void * Micropolis::getPopulationDensityMapBuffer | ( | ) |
Get the address of the internal buffer containing the population density map. This is used to enable the tile engine to access the population density map directly.
Definition at line 1269 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::getBase(), and populationDensityMap.
int Micropolis::getPowerGrid | ( | int | x, |
int | y | ||
) |
Get a value from the power grid map.
x | X coordinate of the position to get, 0 to WORLD_W. |
y | Y coordinate of the position to get, 0 to WORLD_H. |
Definition at line 1203 of file micropolis.cpp.
References powerGridMap, and Map< DATA, BLKSIZE >::worldGet().
void * Micropolis::getPowerGridMapBuffer | ( | ) |
Get the address of the internal buffer containing the power grid map. This is used to enable the tile engine to access the power grid map directly.
Definition at line 1229 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::getBase(), and powerGridMap.
int Micropolis::getProblemNumber | ( | int | i | ) |
Return the index of the i-th worst problem.
i | Number of the problem. |
-1
if such a problem does not exist. Definition at line 545 of file evaluate.cpp.
References CVP_NUMPROBLEMS, CVP_PROBLEM_COMPLAINTS, and problemOrder.
int Micropolis::getProblemVotes | ( | int | i | ) |
Return number of votes to solve the i-th worst problem.
i | Number of the problem. |
-1
if such a problem does not exist. Definition at line 562 of file evaluate.cpp.
References CVP_NUMPROBLEMS, CVP_PROBLEM_COMPLAINTS, problemOrder, and problemVotes.
short Micropolis::getRandom | ( | short | range | ) |
Draw a random number in a given range.
range | Upper bound of the range (inclusive). |
0
and range (inclusive). Definition at line 110 of file random.cpp.
References getRandom16().
Referenced by addToTrafficDensityMap(), buildHouse(), doAirplaneSprite(), doAirport(), doBRiver(), doCommercial(), doDisasters(), doFire(), doFlood(), doHospitalChurch(), doIndustrial(), doMakeSound(), doMeltdown(), doMonsterSprite(), doResidential(), doResOut(), doRivers(), doShipSprite(), doSpecialZone(), doSRiver(), doTornadoSprite(), doTrees(), doVotes(), fireBomb(), generateBus(), generateMap(), generateTrain(), getERandom(), initSprite(), makeEarthquake(), makeFire(), makeFlood(), makeHospital(), makeLakes(), makeMonster(), makeSingleLake(), makeTornado(), makeTraffic(), putDownPark(), putRubble(), setFire(), treeSplash(), and voteProblems().
int Micropolis::getRandom16 | ( | ) |
Get random 16 bit number.
Definition at line 130 of file random.cpp.
References simRandom().
Referenced by buildHouse(), crimeScan(), doBridge(), doCommercial(), doCopterSprite(), doFire(), doFlood(), doIndustrial(), doMonsterSprite(), doRadTile(), doRail(), doResidential(), doRoad(), doShipSprite(), doTrainSprite(), generateShip(), generateSomeRandomCity(), getRandom(), getRandom16Signed(), makeFireBombs(), randomFire(), randomRubble(), and tryGo().
int Micropolis::getRandom16Signed | ( | ) |
Get signed 16 bit random number.
Definition at line 137 of file random.cpp.
References getRandom16().
Referenced by doCommercial(), doIndustrial(), and doResidential().
int Micropolis::getRateOfGrowth | ( | int | x, |
int | y | ||
) |
Get a value from the rate of growth map.
x | X coordinate of the position to get, 0 to WORLD_W_8. |
y | Y coordinate of the position to get, 0 to WORLD_H_8. |
Definition at line 1283 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::get(), and rateOfGrowthMap.
void * Micropolis::getRateOfGrowthMapBuffer | ( | ) |
Get the address of the internal buffer containing the rate of growth map. This is used to enable the tile engine to access the rate of growth map directly.
Definition at line 1309 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::getBase(), and rateOfGrowthMap.
|
private |
Return population of a residential zone center tile (RZB, RZB+9, ..., HOSPITAL - 9).
mapTile | Center tile of a residential zone. |
Definition at line 711 of file zone.cpp.
Referenced by doResidential(), and getPopulationDensity().
|
private |
Compute total score
problemTable | Storage of how bad each problem is. |
Definition at line 371 of file evaluate.cpp.
References cityPop, cityPopDelta, cityScore, cityScoreDelta, cityTax, clamp(), comCap, CVP_NUMPROBLEMS, fireEffect, getFireSeverity(), indCap, MAX_FIRE_STATION_EFFECT, MAX_POLICE_STATION_EFFECT, MAX_ROAD_EFFECT, min(), policeEffect, poweredZoneCount, resCap, roadEffect, and unpoweredZoneCount.
Referenced by cityEvaluation().
SimSprite * Micropolis::getSprite | ( | int | type | ) |
Return the sprite of the give type, if available.
type | Type of the sprite. |
NULL
. Definition at line 338 of file sprite.cpp.
References SimSprite::frame.
Referenced by addToTrafficDensityMap(), doCopterSprite(), doSpecialZone(), generateBus(), generateCopter(), generatePlane(), generateTrain(), makeMonster(), and makeTornado().
int Micropolis::getTile | ( | int | x, |
int | y | ||
) |
Get a tile from the map.
x | X coordinate of the position to get, 0 to WORLD_W. |
y | Y coordinate of the position to get, 0 to WORLD_H. |
Definition at line 1157 of file micropolis.cpp.
References DIRT, map, and testBounds().
|
private |
Get neighbouring tile from the map.
pos | Current position. |
dir | Direction of neighbouring tile, only horizontal and vertical directions are supported. |
defaultTile | Tile to return if off-map. |
DIRT
is returned. Definition at line 407 of file traffic.cpp.
References DIR2_EAST, DIR2_NORTH, DIR2_SOUTH, DIR2_WEST, LOMASK, map, Position::posX, Position::posY, WORLD_H, and WORLD_W.
Referenced by tryGo().
|
private |
Compute average traffic in the city.
Definition at line 315 of file evaluate.cpp.
References landValueMap, Map< DATA, BLKSIZE >::MAP_BLOCKSIZE, trafficAverage, trafficDensityMap, WORLD_H, WORLD_W, and Map< DATA, BLKSIZE >::worldGet().
Referenced by doProblems().
int Micropolis::getTrafficDensity | ( | int | x, |
int | y | ||
) |
Get a value from the traffic density map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
Definition at line 1323 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::get(), and trafficDensityMap.
void * Micropolis::getTrafficDensityMapBuffer | ( | ) |
Get the address of the internal buffer containing the traffic density map. This is used to enable the tile engine to access the traffic density map directly.
Definition at line 1349 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::getBase(), and trafficDensityMap.
|
private |
Compute severity of unemployment
Definition at line 341 of file evaluate.cpp.
References comPop, indPop, min(), and resPop.
Referenced by doProblems().
void Micropolis::graphDoer | ( | ) |
If graph data has been changed, update all graphs. If graphs have been changed, tell the user front-end about it.
Definition at line 132 of file graph.cpp.
References callback, and censusChanged.
Referenced by simUpdate().
|
private |
Update the rate of growth at position pos by amount.
pos | Position to modify. |
amount | Amount of change (can both be positive and negative). |
Definition at line 351 of file zone.cpp.
References clamp(), Position::posX, Position::posY, rateOfGrowthMap, Map< DATA, BLKSIZE >::worldGet(), and Map< DATA, BLKSIZE >::worldSet().
Referenced by doComIn(), doComOut(), doIndIn(), doIndOut(), doResIn(), and doResOut().
|
private |
Place an industrial zone around center tile pos.
pos | Center of the industrial zone. |
den | Population density of the industrial zone (0, 1, 2, or 3). |
value | Landvalue of the industrial zone (0 or 1). |
Definition at line 1017 of file zone.cpp.
References IND1, and zonePlop().
Referenced by doIndIn(), and doIndOut().
void Micropolis::init | ( | ) |
Initialize simulator variables to a sane default.
Definition at line 129 of file micropolis.cpp.
References airportPop, autoBudget, autoBulldoze, autoGoto, blinkFlag, categoryLast, CC_VILLAGE, censusChanged, churchPop, cityAssessedValue, cityCenterX, cityCenterY, cityClass, cityFileName, cityMonth, cityName, cityPop, cityPopDelta, cityPopLast, cityScore, cityScoreDelta, cityTax, cityTime, cityYear, cityYes, Map< DATA, BLKSIZE >::clear(), coalPowerPop, comCap, comHist10Max, comHist120Max, comPop, comRateMap, comZonePop, crimeAverage, crimeMaxX, crimeMaxY, crimeRateMap, curMapStackPointer, curMapStackXY, CVP_PROBLEM_COMPLAINTS, disasterEvent, disasterWait, doAnimation, doInitialEval, doMessages, donDither, doNotices, doSimInit(), enableDisasters, enableSound, evalChanged, faith, fireEffect, fireFund, firePercent, firePop, fireSpend, fireStationEffectMap, fireStationMap, fireStationPop, fireValue, floodCount, freeSprites, gameLevel, graph10Max, graph120Max, heatFlow, heatRule, heatSteps, heatWrap, hospitalPop, indCap, indHist10Max, indHist120Max, indPop, indZonePop, landValueAverage, landValueMap, LEVEL_EASY, MAP_TYPE_COUNT, mapSerial, MAX_TRAFFIC_DISTANCE, mustDrawBudget, mustUpdateOptions, needChurch, needHospital, newMap, newMapFlags, nuclearPowerPop, policeEffect, policeFund, policePercent, policeSpend, policeStationEffectMap, policeStationMap, policeStationPop, policeValue, pollutionAverage, pollutionDensityMap, pollutionMaxX, pollutionMaxY, populationDensityMap, POWER_STACK_SIZE, poweredZoneCount, powerGridMap, powerStackPointer, powerStackXY, problemOrder, problemVotes, railTotal, rateOfGrowthMap, resCap, resHist10Max, resHist120Max, resPop, resZonePop, roadEffect, roadFund, roadPercent, roadSpend, roadTotal, roadValue, SC_NONE, scenario, scoreType, scoreWait, seaportPop, simInit(), simPass, simPasses, simPaused, SPRITE_COUNT, spriteList, stadiumPop, startingYear, taxFlag, taxFund, terrainCreateIsland, terrainCurveLevel, terrainDensityMap, terrainLakeLevel, terrainTreeLevel, tilesAnimated, totalFunds, totalPop, totalPopLast, totalZonePop, trafficAverage, trafficDensityMap, trafMaxX, trafMaxY, and unpoweredZoneCount.
void Micropolis::initFundingLevel | ( | ) |
Definition at line 85 of file budget.cpp.
void Micropolis::initGraphMax | ( | ) |
Compute various max ranges of graphs
Definition at line 151 of file graph.cpp.
References comHist, comHist10Max, comHist120Max, graph10Max, graph120Max, indHist, indHist10Max, indHist120Max, max(), resHist, resHist10Max, and resHist120Max.
Referenced by initWillStuff().
void Micropolis::initGraphs | ( | ) |
Initialize graphs
Definition at line 142 of file graph.cpp.
References historyInitialized.
Referenced by simInit().
|
private |
Allocate and initialize arrays for the maps
Definition at line 88 of file allocate.cpp.
References comHist, crimeHist, HISTORY_LENGTH, indHist, map, mapBase, MISC_HISTORY_LENGTH, miscHist, moneyHist, newPtr(), pollutionHist, resHist, WORLD_H, and WORLD_W.
Referenced by Micropolis().
|
private |
Definition at line 401 of file simulate.cpp.
void Micropolis::initSprite | ( | SimSprite * | sprite, |
int | x, | ||
int | y | ||
) |
Re-initialize an existing sprite.
sprite | Sprite to re-use. |
x | New x coordinate of the sprite (in pixels?). |
y | New y coordinate of the sprite (in pixels?). |
Definition at line 136 of file sprite.cpp.
References SimSprite::destX, SimSprite::destY, SimSprite::frame, getRandom(), pollutionMaxX, pollutionMaxY, SPRITE_AIRPLANE, SPRITE_BUS, SPRITE_EXPLOSION, SPRITE_HELICOPTER, SPRITE_MONSTER, SPRITE_SHIP, SPRITE_TORNADO, SPRITE_TRAIN, SimSprite::type, WORLD_H, WORLD_W, SimSprite::x, SimSprite::xHot, SimSprite::y, and SimSprite::yHot.
Referenced by makeSprite(), and newSprite().
|
private |
Reset many game state variables
Definition at line 85 of file initialize.cpp.
References cityPop, cityScore, Map< DATA, BLKSIZE >::clear(), comRateMap, crimeRateMap, destroyAllSprites(), disasterEvent, doNewGame(), fireEffect, fireFund, fireStationEffectMap, fireStationMap, initGraphMax(), landValueMap, MAX_FIRE_STATION_EFFECT, MAX_POLICE_STATION_EFFECT, MAX_ROAD_EFFECT, policeEffect, policeFund, policeStationEffectMap, policeStationMap, pollutionDensityMap, populationDensityMap, randomlySeedRandom(), rateOfGrowthMap, roadEffect, roadFund, SC_NONE, taxFlag, terrainDensityMap, and trafficDensityMap.
Referenced by generateSomeCity(), loadFile(), loadScenario(), and simInit().
void Micropolis::invalidateMaps | ( | ) |
Tell the front-end that the maps are not valid any more
Definition at line 1123 of file micropolis.cpp.
References callback, and mapSerial.
Referenced by generateSomeCity(), loadFile(), loadScenario(), toolDown(), and toolDrag().
|
private |
Definition at line 406 of file generate.cpp.
|
private |
Definition at line 1328 of file tool.cpp.
References ToolEffects::addFrontendMessage(), putDownLand(), testBounds(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by doTool().
|
private |
Builldoze a tile (make it a RIVER or DIRT).
x | X map coordinate. |
y | Y map coordinate. |
effects | Modification collecting object. |
Definition at line 222 of file connect.cpp.
References ToolEffects::addCost(), BULLBIT, DIRT, ToolEffects::getMapValue(), HBRIDGE, LOMASK, neutralizeRoad(), ToolEffects::setMapValue(), TOOLRESULT_FAILED, TOOLRESULT_OK, and VBRIDGE.
Referenced by connectTile().
|
private |
Lay a rail, and update connections (rail, road, and wire) around it.
x | X map coordinate. |
y | Y map coordinate. |
effects | Modification collecting object. |
Definition at line 364 of file connect.cpp.
References ToolEffects::addCost(), BULLBIT, BURNBIT, CONDBIT, DIRT, ToolEffects::getMapTile(), neutralizeRoad(), RAILHPOWERV, RAILVPOWERH, ToolEffects::setMapValue(), TOOLRESULT_FAILED, TOOLRESULT_OK, WORLD_H, and WORLD_W.
Referenced by connectTile().
|
private |
Lay a road, and update road around it.
x | X map coordinate. |
y | Y map coordinate. |
effects | Modification collecting object. |
Definition at line 271 of file connect.cpp.
References ToolEffects::addCost(), BULLBIT, BURNBIT, CONDBIT, DIRT, ToolEffects::getMapTile(), HBRIDGE, neutralizeRoad(), ToolEffects::setMapValue(), TOOLRESULT_FAILED, TOOLRESULT_OK, VBRIDGE, WORLD_H, and WORLD_W.
Referenced by connectTile().
|
private |
Lay a wire, and update connections (rail, road, and wire) around it.
x | X map coordinate. |
y | Y map coordinate. |
effects | Modification collecting object. |
Definition at line 460 of file connect.cpp.
References ToolEffects::addCost(), BULLBIT, BURNBIT, CONDBIT, DIRT, ToolEffects::getMapTile(), ToolEffects::getMapValue(), LOMASK, neutralizeRoad(), RAILHPOWERV, RAILVPOWERH, ToolEffects::setMapValue(), TOOLRESULT_FAILED, TOOLRESULT_OK, WORLD_H, and WORLD_W.
Referenced by connectTile().
bool Micropolis::loadCity | ( | const std::string & | filename | ) |
Try to load a new game from disk.
filename | Name of the file to load. |
In what state is the game left when loading fails?
String normalization code is duplicated in Micropolis::saveCityAs(). Extract to a sub-function.
lastDot<lastSlash
(ie with "x.y/bla"
) Definition at line 536 of file fileio.cpp.
References cityFileName, didLoadCity(), didntLoadCity(), doSimInit(), and loadFile().
bool Micropolis::loadFile | ( | const std::string & | filename | ) |
Load a file, and initialize the game variables.
filename | Name of the file to load. |
Definition at line 276 of file fileio.cpp.
References changeCensus(), cityTax, cityTime, doInitialEval, doSimInit(), firePercent, HALF_SWAP_LONGS, initWillStuff(), invalidateMaps(), loadFileData(), max(), miscHist, mustUpdateOptions, policePercent, roadPercent, SC_NONE, scenario, setAutoBudget(), setAutoBulldoze(), setAutoGoto(), setEnableSound(), and setFunds().
Referenced by loadCity().
bool Micropolis::loadFileData | ( | const std::string & | filename | ) |
Load a city file from a given filename and (optionally) directory.
filename | Name of the file to load. |
dir | If not NULL , name of the directory containing the file. |
Definition at line 213 of file fileio.cpp.
References comHist, crimeHist, HISTORY_LENGTH, indHist, load_short(), mapBase, MISC_HISTORY_LENGTH, miscHist, moneyHist, pollutionHist, resHist, WORLD_H, and WORLD_W.
Referenced by loadFile(), and loadScenario().
void Micropolis::loadScenario | ( | Scenario | s | ) |
Load a scenario.
s | Scenario to load. |
SC_NONE
. Definition at line 429 of file fileio.cpp.
References cityFileName, cityTime, didLoadScenario(), doInitialEval, doSimInit(), initWillStuff(), invalidateMaps(), LEVEL_EASY, loadFileData(), NOT_REACHED, SC_BERN, SC_BOSTON, SC_DETROIT, SC_DULLSVILLE, SC_HAMBURG, SC_RIO, SC_SAN_FRANCISCO, SC_TOKYO, scenario, setCleanCityName(), setFunds(), setGameLevel(), and updateFunds().
|
private |
Definition at line 89 of file utilities.cpp.
void Micropolis::makeEarthquake | ( | ) |
Change random tiles to fire or dirt as result of the earthquake
Definition at line 257 of file disasters.cpp.
References cityCenterX, cityCenterY, doEarthquake(), getRandom(), map, MESSAGE_EARTHQUAKE, randomFire(), randomRubble(), sendMessage(), vulnerable(), WORLD_H, and WORLD_W.
Referenced by doDisasters(), and scenarioDisaster().
void Micropolis::makeExplosion | ( | int | x, |
int | y | ||
) |
Construct an explosion sprite.
x | X coordinate of the explosion (in map coordinates). |
y | Y coordinate of the explosion (in map coordinates). |
Definition at line 2020 of file sprite.cpp.
References makeExplosionAt(), and testBounds().
Referenced by doMeltdown(), and fireBomb().
void Micropolis::makeExplosionAt | ( | int | x, |
int | y | ||
) |
Construct an explosion sprite.
x | X coordinate of the explosion (in pixels). |
y | Y coordinate of the explosion (in pixels). |
Definition at line 2033 of file sprite.cpp.
References newSprite(), and SPRITE_EXPLOSION.
Referenced by destroyMapTile(), doFire(), explodeSprite(), and makeExplosion().
void Micropolis::makeFire | ( | ) |
Start a fire at a random place, requested by user
Definition at line 304 of file disasters.cpp.
References BURNBIT, getRandom(), LASTZONE, LOMASK, map, MESSAGE_FIRE_REPORTED, randomFire(), sendMessage(), WORLD_H, WORLD_W, and ZONEBIT.
void Micropolis::makeFireBombs | ( | ) |
Throw several bombs onto the city.
Definition at line 243 of file disasters.cpp.
References fireBomb(), and getRandom16().
Referenced by scenarioDisaster().
void Micropolis::makeFlood | ( | ) |
Flood many tiles
Definition at line 346 of file disasters.cpp.
References BULLBIT, BURNBIT, DIRT, floodCount, getRandom(), LOMASK, map, MESSAGE_FLOODING_REPORTED, sendMessage(), testBounds(), WATER_HIGH, WORLD_H, and WORLD_W.
Referenced by doDisasters(), and scenarioDisaster().
|
private |
If needed, add a new hospital or a new church.
pos | Center position of the new hospital or church. |
Definition at line 292 of file zone.cpp.
References getRandom(), needChurch, needHospital, and zonePlop().
Referenced by doResidential().
void Micropolis::makeIsland | ( | ) |
Construct a new world as an island
Definition at line 248 of file generate.cpp.
References doTrees(), and makeNakedIsland().
Referenced by generateMap().
|
private |
Make a number of lakes, depending on the Micropolis::terrainLakeLevel.
Definition at line 259 of file generate.cpp.
References getRandom(), makeSingleLake(), terrainLakeLevel, WORLD_H, and WORLD_W.
Referenced by generateMap().
void Micropolis::makeMeltdown | ( | ) |
Make a nuclear power plant melt
Definition at line 217 of file disasters.cpp.
References doMeltdown(), LOMASK, map, NUCLEAR, WORLD_H, and WORLD_W.
Referenced by scenarioDisaster().
void Micropolis::makeMonster | ( | ) |
Start a new monster sprite.
Definition at line 1917 of file sprite.cpp.
References BULLBIT, SimSprite::destX, SimSprite::destY, getRandom(), getSprite(), makeMonsterAt(), map, pollutionMaxX, pollutionMaxY, SPRITE_MONSTER, WORLD_H, and WORLD_W.
Referenced by doDisasters(), and scenarioDisaster().
void Micropolis::makeMonsterAt | ( | int | x, |
int | y | ||
) |
Start a new monster sprite at the given map tile.
x | X coordinate in map coordinate. |
y | Y coordinate in map coordinate. |
Definition at line 1956 of file sprite.cpp.
References makeSprite(), MESSAGE_MONSTER_SIGHTED, sendMessage(), and SPRITE_MONSTER.
Referenced by makeMonster().
|
private |
Construct a plain island as world, surrounded by 5 tiles of river.
Definition at line 204 of file generate.cpp.
References DIRT, getERandom(), ISLAND_RADIUS, map, plopBRiver(), plopSRiver(), WORLD_H, and WORLD_W.
Referenced by generateMap(), and makeIsland().
void Micropolis::makeShipHere | ( | int | x, |
int | y | ||
) |
Start a new ship sprite at the given map tile.
x | X coordinate in map coordinate. |
y | Y coordinate in map coordinate. |
Definition at line 1905 of file sprite.cpp.
References makeSprite(), and SPRITE_SHIP.
Referenced by generateShip().
void Micropolis::makeSingleLake | ( | const Position & | pos | ) |
Make a random lake at pos.
pos | Rough position of the lake. |
Definition at line 283 of file generate.cpp.
References getRandom(), plopBRiver(), and plopSRiver().
Referenced by makeLakes().
void Micropolis::makeSound | ( | const std::string & | channel, |
const std::string & | sound, | ||
int | x = -1 , |
||
int | y = -1 |
||
) |
Instruct the front-end to make a sound.
channel | Name of the sound channel, which can effect the sound (location, volume, spatialization, etc). Use "city" for city sounds effects, and "interface" for user interface sounds. |
sound | Name of the sound. |
x | Tile X position of sound, 0 to WORLD_W, or -1 for everywhere. |
y | Tile Y position of sound, 0 to WORLD_H, or -1 for everywhere. |
Definition at line 1140 of file micropolis.cpp.
References callback, and enableSound.
Referenced by doCopterSprite(), doEarthquake(), doExplosionSprite(), doMakeSound(), doMonsterSprite(), doShipSprite(), explodeSprite(), FrontendMessageMakeSound::sendMessage(), and toolDown().
SimSprite * Micropolis::makeSprite | ( | int | type, |
int | x, | ||
int | y | ||
) |
Make a sprite either by re-using the old one, or by making a new one.
type | Sprite type of the new sprite. |
x | X coordinate of the new sprite. |
y | Y coordinate of the new sprite. |
Definition at line 355 of file sprite.cpp.
References initSprite(), and newSprite().
Referenced by generateBus(), generateCopter(), generatePlane(), generateTrain(), makeMonsterAt(), makeShipHere(), and makeTornado().
void Micropolis::makeTornado | ( | ) |
Ensure a tornado sprite exists.
Definition at line 1996 of file sprite.cpp.
References getRandom(), getSprite(), makeSprite(), MESSAGE_TORNADO_SIGHTED, sendMessage(), SPRITE_TORNADO, WORLD_H, and WORLD_W.
Referenced by doDisasters().
Find a connection over a road from startPos to a specified zone type.
startPos | Start position of the attempt. |
dest | Zone type to go to. |
1
if connection found, 0
if not found, -1
if no connection to road found. Definition at line 134 of file traffic.cpp.
References addToTrafficDensityMap(), curMapStackPointer, findPerimeterRoad(), findPerimeterTelecom(), getRandom(), and tryDrive().
short Micropolis::makeTraffic | ( | int | x, |
int | y, | ||
ZoneType | dest | ||
) |
Find a connection over a road from position x y to a specified zone type.
x | Start x position of the attempt |
y | Start y position of the attempt |
dest | Zone type to go to. |
1
if connection found, 0
if not found, -1
if no connection to road found. Definition at line 118 of file traffic.cpp.
References makeTraffic(), Position::posX, and Position::posY.
Referenced by doCommercial(), doIndustrial(), doResidential(), and makeTraffic().
short Micropolis::makeTrafficAt | ( | int | x, |
int | y, | ||
ZoneType | dest | ||
) |
Makes traffic starting from the road tile at \x, \y.
x | Start x position of the attempt |
y | Start y position of the attempt |
dest | Zone type to go to. |
1
if connection found, 0
if not found, -1
if no connection to road found. Definition at line 95 of file traffic.cpp.
References addToTrafficDensityMap(), Position::posX, Position::posY, and tryDrive().
|
private |
Definition at line 947 of file simulate.cpp.
void Micropolis::moveObjects | ( | ) |
Move all sprites.
Sprites with SimSprite::frame == 0 are removed.
It uses SimSprite::name[0] == '\0' as condition which seems stupid.
Micropolis::destroySprite modifies the Micropolis::spriteList while we loop over it.
Definition at line 553 of file sprite.cpp.
References destroySprite(), doAirplaneSprite(), doBusSprite(), doCopterSprite(), doExplosionSprite(), doMonsterSprite(), doShipSprite(), doTornadoSprite(), doTrainSprite(), SimSprite::frame, SimSprite::name, SimSprite::next, SPRITE_AIRPLANE, SPRITE_BUS, SPRITE_EXPLOSION, SPRITE_HELICOPTER, SPRITE_MONSTER, SPRITE_SHIP, SPRITE_TORNADO, SPRITE_TRAIN, spriteList, and SimSprite::type.
|
private |
Put down a network.
Definition at line 1286 of file tool.cpp.
References ToolEffects::addFrontendMessage(), putDownNetwork(), testBounds(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by doTool().
Ptr Micropolis::newPtr | ( | int | size | ) |
Claim size bytes of memory.
size | Number of bytes to claim. |
Definition at line 1074 of file micropolis.cpp.
Referenced by initMapArrays(), newSprite(), and simHeat().
SimSprite * Micropolis::newSprite | ( | const std::string & | name, |
int | type, | ||
int | x, | ||
int | y | ||
) |
Create and initialize a sprite.
name | Name of the sprite (always "" ). |
type | Type pf the sprite. |
x | X coordinate of the sprite (in pixels). |
y | Y coordinate of the sprite (in pixels). |
Definition at line 104 of file sprite.cpp.
References freeSprites, initSprite(), SimSprite::name, newPtr(), SimSprite::next, spriteList, and SimSprite::type.
Referenced by makeExplosionAt(), and makeSprite().
|
private |
Build a park.
x | Horizontal position of 'center tile' of the park. |
y | Vertical position of 'center tile' of the park. |
effects | Storage of effects of putting down the park. |
Definition at line 1198 of file tool.cpp.
References ToolEffects::addFrontendMessage(), putDownPark(), testBounds(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by doTool().
void Micropolis::pause | ( | ) |
void Micropolis::plopBRiver | ( | const Position & | pos | ) |
Put down a big river diamond-like shape.
pos | Base coordinate of the blob (top-left position). |
Definition at line 623 of file generate.cpp.
References Position::posX, Position::posY, and putOnMap().
Referenced by doBRiver(), makeNakedIsland(), and makeSingleLake().
void Micropolis::plopSRiver | ( | const Position & | pos | ) |
Put down a small river diamond-like shape.
pos | Base coordinate of the blob (top-left position). |
Definition at line 650 of file generate.cpp.
References Position::posX, Position::posY, and putOnMap().
Referenced by doSRiver(), makeNakedIsland(), and makeSingleLake().
void Micropolis::populationDensityScan | ( | ) |
Definition at line 136 of file scan.cpp.
References cityCenterX, cityCenterY, Map< DATA, BLKSIZE >::clear(), computeComRateMap(), Map< DATA, BLKSIZE >::getBase(), getPopulationDensity(), LOMASK, map, Map< DATA, BLKSIZE >::MAP_H, MAP_TYPE_DYNAMIC, MAP_TYPE_POPULATION_DENSITY, MAP_TYPE_RATE_OF_GROWTH, Map< DATA, BLKSIZE >::MAP_W, min(), newMapFlags, populationDensityMap, tempMap1, tempMap2, WORLD_H, WORLD_W, Map< DATA, BLKSIZE >::worldSet(), and ZONEBIT.
Referenced by doSimInit().
|
private |
Prepare the site where a building is about to be put down.
This function performs some basic sanity checks, and implements the auto-bulldoze functionality to prepare the site. All effects are stored in the effects object.
leftX | Position of left column of tiles of the building. |
topY | Position of top row of tiles of the building. |
sizeX | Horizontal size of the building. |
sizeY | Vertical size of the building. |
effects | Storage of effects of preparing the site. |
Definition at line 657 of file tool.cpp.
References ToolEffects::addCost(), autoBulldoze, DIRT, gCostOf, ToolEffects::getMapTile(), ToolEffects::setMapValue(), tally(), TOOLRESULT_FAILED, TOOLRESULT_NEED_BULLDOZE, TOOLRESULT_OK, WORLD_H, and WORLD_W.
Referenced by buildBuilding().
|
private |
Pull top-most position from the position stack.
Definition at line 223 of file traffic.cpp.
References curMapStackPointer, and curMapStackXY.
Referenced by addToTrafficDensityMap().
|
private |
Pull a position from the power stack.
Definition at line 187 of file power.cpp.
References powerStackPointer, and powerStackXY.
Referenced by doPowerScan().
|
private |
Push a position onto the position stack.
pos | Position to push. |
Definition at line 210 of file traffic.cpp.
References curMapStackPointer, curMapStackXY, and MAX_TRAFFIC_DISTANCE.
Referenced by tryDrive().
|
private |
Push position pos onto the power stack if there is room.
pos | Position to push. |
Definition at line 173 of file power.cpp.
References POWER_STACK_SIZE, powerStackPointer, and powerStackXY.
Referenced by doPowerScan(), and doSpecialZone().
|
private |
Put down a building, starting at (leftX, topY) with size (sizeX, sizeY).
leftX | Position of left column of tiles of the building. |
topY | Position of top row of tiles of the building. |
sizeX | Horizontal size of the building. |
sizeY | Vertical size of the building. |
baseTile | Tile value to use at the top-left position. Tiles are laid in column major mode. |
aniFlag | Set animation flag at relative position (1, 2) |
effects | Storage of the effects. |
Definition at line 617 of file tool.cpp.
References ANIMBIT, ToolEffects::setMapValue(), and ZONEBIT.
Referenced by buildBuilding().
|
private |
Put down a forest tile.
mapH | X coordinate of the tile. |
mapV | Y coordinate of the tile. |
Definition at line 366 of file tool.cpp.
References ToolEffects::addCost(), gCostOf, ToolEffects::setMapValue(), smoothTreesAt(), testBounds(), and TOOLRESULT_OK.
Referenced by forestTool().
|
private |
Put down a land tile.
mapH | X coordinate of the tile. |
mapV | Y coordinate of the tile. |
Auto-bulldoze deducts always 1.
Auto-bulldoze costs should be pulled from a table/constant.
Definition at line 333 of file tool.cpp.
References ToolEffects::addCost(), DIRT, gCostOf, ToolEffects::getMapTile(), ToolEffects::setMapValue(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by landTool().
|
private |
Put down a communication network.
mapH | X coordinate of the tile. |
mapV | Y coordinate of the tile. |
effects | Storage of effects of putting down the park. |
Definition at line 282 of file tool.cpp.
References ToolEffects::addCost(), ANIMBIT, BULLBIT, BURNBIT, CONDBIT, DIRT, gCostOf, ToolEffects::getMapTile(), ToolEffects::setMapValue(), tally(), TOOLRESULT_NEED_BULLDOZE, and TOOLRESULT_OK.
Referenced by networkTool().
|
private |
Put a park down at the give tile.
mapH | X coordinate of the tile. |
mapV | Y coordinate of the tile. |
effects | Storage of effects of putting down the park. |
Definition at line 252 of file tool.cpp.
References ToolEffects::addCost(), ANIMBIT, BULLBIT, BURNBIT, DIRT, gCostOf, ToolEffects::getMapValue(), getRandom(), ToolEffects::setMapValue(), TOOLRESULT_NEED_BULLDOZE, and TOOLRESULT_OK.
Referenced by parkTool().
|
private |
Put down a water tile.
mapH | X coordinate of the tile. |
mapV | Y coordinate of the tile. |
Definition at line 310 of file tool.cpp.
References ToolEffects::addCost(), gCostOf, ToolEffects::getMapTile(), ToolEffects::setMapValue(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
|
private |
Put mChar onto the map at position xLoc, yLoc if possible.
mChar | Map value to put ont the map. |
xLoc | Horizontal position at the map to put mChar. |
yLoc | Vertical position at the map to put mChar. |
Definition at line 593 of file generate.cpp.
References DIRT, LOMASK, map, and testBounds().
Referenced by plopBRiver(), and plopSRiver().
|
private |
Make a size by size tiles square of rubble
x | Horizontal position of the left-most tile |
y | Vertical position of the left-most tile |
size | Size of the rubble square |
Definition at line 923 of file tool.cpp.
References ANIMBIT, BULLBIT, DIRT, doAnimation, ToolEffects::getMapTile(), getRandom(), RADTILE, ToolEffects::setMapValue(), and testBounds().
Referenced by bulldozerTool().
|
private |
Do query tool.
x | X coordinate of the position of the query. |
y | Y coordinate of the position of the query. |
Definition at line 972 of file tool.cpp.
References didTool(), doZoneStatus(), testBounds(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by doTool().
|
private |
Build a rail track at a tile.
x | Horizontal position of the tile. |
y | Vertical position of the tile. |
effects | Storage of effects of laying the rail. |
Definition at line 1146 of file tool.cpp.
References ToolEffects::addFrontendMessage(), CONNECT_TILE_RAILROAD, connectTile(), testBounds(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by doTool().
|
inlineprivate |
Generate a random animated Tiles::FIRE tile
Definition at line 2147 of file micropolis.h.
References ANIMBIT, and getRandom16().
Referenced by doFire(), doMeltdown(), makeEarthquake(), makeFire(), setFire(), and startFire().
void Micropolis::randomlySeedRandom | ( | ) |
Initialize the random number generator with a 'random' seed.
Definition at line 165 of file random.cpp.
References seedRandom().
Referenced by initWillStuff().
|
inlineprivate |
Generate a random Tiles::RUBBLE tile
Definition at line 2153 of file micropolis.h.
References BULLBIT, and getRandom16().
Referenced by doFire(), doRail(), doRoad(), and makeEarthquake().
void Micropolis::reallyUpdateFunds | ( | ) |
Definition at line 133 of file update.cpp.
Repair a zone at pos.
pos | Center-tile position of the zone. |
zCent | Value of the center tile. |
zSize | Size of the zone (in both directions). |
Definition at line 1410 of file simulate.cpp.
References ANIMBIT, BURNBIT, CONDBIT, LOMASK, map, Position::posX, Position::posY, testBounds(), and ZONEBIT.
Referenced by doHospitalChurch(), and doSpecialZone().
|
private |
Reset all tools in the simulator editor.
Definition at line 141 of file initialize.cpp.
Referenced by generateSomeCity(), and simInit().
|
private |
Reset all maps in the simulator.
Definition at line 131 of file initialize.cpp.
Referenced by generateSomeCity(), and simInit().
|
private |
Put down a residential zone.
pos | Center tile of the residential zone. |
den | Population density (0..3) |
value | Land value - pollution (0..3), higher is better. |
Definition at line 724 of file zone.cpp.
References zonePlop().
Referenced by doResIn(), and doResOut().
void Micropolis::resume | ( | ) |
|
private |
Can the given tile be used as road?
mv | Value from the map. |
Definition at line 503 of file traffic.cpp.
References LOMASK.
Referenced by findPerimeterRoad(), and tryGo().
|
private |
Build a road at a tile.
x | Horizontal position of the tile to lay road. |
y | Vertical position of the tile to lay road. |
effects | Storage of effects of laying raod at the tile. |
Definition at line 1120 of file tool.cpp.
References ToolEffects::addFrontendMessage(), CONNECT_TILE_ROAD, connectTile(), testBounds(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by doTool().
void Micropolis::saveCity | ( | ) |
Try to save the game.
Definition at line 589 of file fileio.cpp.
References cityFileName, didntSaveCity(), didSaveCity(), doSaveCityAs(), and saveFile().
void Micropolis::saveCityAs | ( | const std::string & | filename | ) |
Save the city under a new name (?)
filename | Name of the file to use for storing the game. |
lastDot<lastSlash
(ie with "x.y/bla"
) Definition at line 646 of file fileio.cpp.
References cityFileName, cityName, didntSaveCity(), didSaveCity(), and saveFile().
bool Micropolis::saveFile | ( | const std::string & | filename | ) |
Save a game to disk.
filename | Name of the file to use for storing the game. |
Definition at line 364 of file fileio.cpp.
References autoBudget, autoBulldoze, autoGoto, cityTax, cityTime, comHist, crimeHist, enableSound, firePercent, HALF_SWAP_LONGS, HISTORY_LENGTH, indHist, map, MISC_HISTORY_LENGTH, miscHist, moneyHist, policePercent, pollutionHist, resHist, roadPercent, save_short(), totalFunds, WORLD_H, and WORLD_W.
Referenced by saveCity(), and saveCityAs().
|
private |
Let disasters of the scenario happen
Definition at line 158 of file disasters.cpp.
References disasterEvent, disasterWait, makeEarthquake(), makeFireBombs(), makeFlood(), makeMeltdown(), makeMonster(), NOT_REACHED, SC_BERN, SC_BOSTON, SC_DETROIT, SC_DULLSVILLE, SC_HAMBURG, SC_NONE, SC_RIO, SC_SAN_FRANCISCO, and SC_TOKYO.
Referenced by doDisasters().
void Micropolis::scoreDoer | ( | ) |
Update the score after being requested.
Definition at line 515 of file evaluate.cpp.
References doScoreCard(), and evalChanged.
Referenced by simUpdate().
void Micropolis::seedRandom | ( | int | seed | ) |
Set seed of the random number generator.
seed | New seed. |
Definition at line 177 of file random.cpp.
Referenced by generateMap(), and randomlySeedRandom().
void Micropolis::sendMessage | ( | short | messageIndex, |
short | x = NOWHERE , |
||
short | y = NOWHERE , |
||
bool | picture = false , |
||
bool | important = false |
||
) |
Send the user a message of an event that happens at a particular position in the city.
messageIndex | Message number of the message to display. |
x | X coordinate of the position of the event. |
y | Y coordinate of the position of the event. |
picture | Flag that is true if a picture should be shown. |
important | Flag that is true if the message is important. |
Definition at line 390 of file message.cpp.
References callback.
Referenced by checkGrowth(), doBudgetNow(), doCopterSprite(), doExplosionSprite(), doMeltdown(), doPowerScan(), doScenarioScore(), explodeSprite(), fireBomb(), makeEarthquake(), makeFire(), makeFlood(), makeMonsterAt(), makeTornado(), sendMessages(), setFire(), toolDown(), and updateDate().
void Micropolis::sendMessages | ( | ) |
Check progress of the user, and send him messages about it.
Definition at line 87 of file message.cpp.
References airportPop, checkGrowth(), cityTax, cityTime, coalPowerPop, comCap, comPop, comZonePop, crimeAverage, doScenarioScore(), fireEffect, fireStationPop, indCap, indPop, indZonePop, MAX_FIRE_STATION_EFFECT, MAX_POLICE_STATION_EFFECT, MAX_ROAD_EFFECT, MESSAGE_BLACKOUTS_REPORTED, MESSAGE_FIRE_STATION_NEEDS_FUNDING, MESSAGE_HIGH_CRIME, MESSAGE_HIGH_POLLUTION, MESSAGE_NEED_AIRPORT, MESSAGE_NEED_ELECTRICITY, MESSAGE_NEED_FIRE_STATION, MESSAGE_NEED_MORE_COMMERCIAL, MESSAGE_NEED_MORE_INDUSTRIAL, MESSAGE_NEED_MORE_RAILS, MESSAGE_NEED_MORE_RESIDENTIAL, MESSAGE_NEED_MORE_ROADS, MESSAGE_NEED_POLICE_STATION, MESSAGE_NEED_SEAPORT, MESSAGE_NEED_STADIUM, MESSAGE_POLICE_NEEDS_FUNDING, MESSAGE_ROAD_NEEDS_FUNDING, MESSAGE_TAX_TOO_HIGH, MESSAGE_TRAFFIC_JAMS, nuclearPowerPop, policeEffect, policeStationPop, pollutionAverage, poweredZoneCount, railTotal, resCap, resPop, resZonePop, roadEffect, roadTotal, SC_NONE, scenario, scoreType, scoreWait, seaportPop, sendMessage(), stadiumPop, totalPop, totalZonePop, trafficAverage, and unpoweredZoneCount.
void Micropolis::setAutoBudget | ( | bool | value | ) |
Set the auto-budget to the given value.
value | New value for the auto-budget setting. |
Definition at line 328 of file utilities.cpp.
References autoBudget, and mustUpdateOptions.
Referenced by doBudgetNow(), loadFile(), and simInit().
void Micropolis::setAutoBulldoze | ( | bool | value | ) |
Set the autoBulldoze flag to the given value, and set the mustUpdateOptions flag to update the user interface.
value | The value to set autoBulldoze to. |
Definition at line 342 of file utilities.cpp.
References autoBulldoze, and mustUpdateOptions.
Referenced by loadFile(), and simInit().
void Micropolis::setAutoGoto | ( | bool | value | ) |
Set the autoGoto flag to the given value, and set the mustUpdateOptions flag to update the user interface.
value | The value to set autoGoto to. |
Definition at line 356 of file utilities.cpp.
References autoGoto, and mustUpdateOptions.
Referenced by loadFile(), and simInit().
void Micropolis::setCallback | ( | Callback * | callback, |
emscripten::val | callbackVal | ||
) |
Definition at line 118 of file micropolis.cpp.
void Micropolis::setCityName | ( | const std::string & | name | ) |
Definition at line 250 of file utilities.cpp.
void Micropolis::setCityTax | ( | short | tax | ) |
Definition at line 345 of file budget.cpp.
void Micropolis::setCleanCityName | ( | const std::string & | name | ) |
Set the name of the city.
name | New name of the city. |
Definition at line 272 of file utilities.cpp.
References callback, and cityName.
Referenced by loadScenario().
|
private |
Definition at line 552 of file simulate.cpp.
void Micropolis::setCrimeRate | ( | int | x, |
int | y, | ||
int | rate | ||
) |
Set a value in the crime rate map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
rate | the value to set. |
Definition at line 1417 of file micropolis.cpp.
References crimeRateMap, and Map< DATA, BLKSIZE >::set().
void Micropolis::setDemand | ( | float | r, |
float | c, | ||
float | i | ||
) |
Definition at line 242 of file update.cpp.
void Micropolis::setDoAnimation | ( | bool | value | ) |
Set the doAnimation flag to the given value, and set the mustUpdateOptions flag to update the user interface.
value | The value to set doAnimation to. |
Definition at line 384 of file utilities.cpp.
References doAnimation, and mustUpdateOptions.
void Micropolis::setDoMessages | ( | bool | value | ) |
Set the doMessages flag to the given value, and set the mustUpdateOptions flag to update the user interface.
value | The value to set doMessages to. |
Definition at line 398 of file utilities.cpp.
References doMessages, and mustUpdateOptions.
void Micropolis::setDoNotices | ( | bool | value | ) |
Set the doNotices flag to the given value, and set the mustUpdateOptions flag to update the user interface.
value | The value to set doNotices to. |
Definition at line 412 of file utilities.cpp.
References doNotices, and mustUpdateOptions.
void Micropolis::setEnableDisasters | ( | bool | value | ) |
set the enableDisasters flag, and set the flag to update the user interface.
value | New setting for enableDisasters |
Definition at line 317 of file utilities.cpp.
References enableDisasters, and mustUpdateOptions.
Referenced by simInit().
void Micropolis::setEnableSound | ( | bool | value | ) |
Set the enableSound flag to the given value, and set the mustUpdateOptions flag to update the user interface.
value | The value to set enableSound to. |
Definition at line 370 of file utilities.cpp.
References enableSound, and mustUpdateOptions.
Referenced by loadFile(), and simInit().
void Micropolis::setFire | ( | ) |
Start a fire at a random place, random disaster or scenario
Definition at line 285 of file disasters.cpp.
References getRandom(), LASTZONE, LOMASK, map, MESSAGE_FIRE_REPORTED, randomFire(), sendMessage(), WORLD_H, WORLD_W, and ZONEBIT.
Referenced by doDisasters().
void Micropolis::setFireCoverage | ( | int | x, |
int | y, | ||
int | coverage | ||
) |
Set a value in the fire coverage map.
x | X coordinate of the position to get, 0 to WORLD_W_8. |
y | Y coordinate of the position to get, 0 to WORLD_H_8. |
coverage | the value to set. |
Definition at line 1497 of file micropolis.cpp.
References fireStationEffectMap, and Map< DATA, BLKSIZE >::set().
void Micropolis::setFunds | ( | int | dollars | ) |
Set player funds to dollars.
Modify the player funds, and warn the front-end about the new amount of money.
dollars | New value for the player funds. |
Definition at line 1048 of file micropolis.cpp.
References totalFunds, and updateFunds().
Referenced by loadFile(), loadScenario(), setGameLevelFunds(), simInit(), and spend().
void Micropolis::setGameLevel | ( | GameLevel | level | ) |
Set/change the game level.
level | New game level. |
Definition at line 235 of file utilities.cpp.
References gameLevel, LEVEL_FIRST, LEVEL_LAST, and updateGameLevel().
Referenced by loadScenario(), setGameLevelFunds(), and simLoadInit().
void Micropolis::setGameLevelFunds | ( | GameLevel | level | ) |
Set the game level and initial funds.
level | New game level. |
Definition at line 208 of file utilities.cpp.
References LEVEL_EASY, LEVEL_HARD, LEVEL_MEDIUM, setFunds(), and setGameLevel().
Referenced by simInit().
void Micropolis::setHistory | ( | int | historyType, |
int | historyScale, | ||
int | historyIndex, | ||
short | historyValue | ||
) |
Store a value into the history tables.
historyType | Type of history information. |
historyScale | Scale of history data. |
historyIndex | Index in the data to obtain |
historyValue | Index in the value to store |
Definition at line 348 of file graph.cpp.
References comHist, crimeHist, HISTORY_COUNT, HISTORY_SCALE_COUNT, HISTORY_SCALE_LONG, HISTORY_SCALE_SHORT, HISTORY_TYPE_COM, HISTORY_TYPE_COUNT, HISTORY_TYPE_CRIME, HISTORY_TYPE_IND, HISTORY_TYPE_MONEY, HISTORY_TYPE_POLLUTION, HISTORY_TYPE_RES, indHist, moneyHist, NOT_REACHED, pollutionHist, and resHist.
void Micropolis::setLandValue | ( | int | x, |
int | y, | ||
int | value | ||
) |
Set a value in the land value map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
value | the value to set. |
Definition at line 1457 of file micropolis.cpp.
References landValueMap, and Map< DATA, BLKSIZE >::set().
void Micropolis::setPasses | ( | int | passes | ) |
Definition at line 197 of file utilities.cpp.
void Micropolis::setPoliceCoverage | ( | int | x, |
int | y, | ||
int | coverage | ||
) |
Set a value in the police coverage map.
x | X coordinate of the position to get, 0 to WORLD_W_8. |
y | Y coordinate of the position to get, 0 to WORLD_H_8. |
coverage | the value to set. |
Definition at line 1536 of file micropolis.cpp.
References policeStationEffectMap, and Map< DATA, BLKSIZE >::set().
void Micropolis::setPollutionDensity | ( | int | x, |
int | y, | ||
int | density | ||
) |
Set a value in the pollition density map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
density | the value to set. |
Definition at line 1377 of file micropolis.cpp.
References pollutionDensityMap, and Map< DATA, BLKSIZE >::set().
void Micropolis::setPopulationDensity | ( | int | x, |
int | y, | ||
int | density | ||
) |
Set a value in the population density map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
density | the value to set. |
Definition at line 1257 of file micropolis.cpp.
References populationDensityMap, and Map< DATA, BLKSIZE >::set().
void Micropolis::setPowerGrid | ( | int | x, |
int | y, | ||
int | power | ||
) |
Set a value in the power grid map.
x | X coordinate of the position to get, 0 to WORLD_W. |
y | Y coordinate of the position to get, 0 to WORLD_H. |
power | the value to set. |
Definition at line 1217 of file micropolis.cpp.
References powerGridMap, and Map< DATA, BLKSIZE >::worldSet().
void Micropolis::setRateOfGrowth | ( | int | x, |
int | y, | ||
int | rate | ||
) |
Set a value in the rate of growth map.
x | X coordinate of the position to get, 0 to WORLD_W_8. |
y | Y coordinate of the position to get, 0 to WORLD_H_8. |
rate | the value to set. |
Definition at line 1297 of file micropolis.cpp.
References rateOfGrowthMap, and Map< DATA, BLKSIZE >::set().
|
private |
Definition at line 237 of file zone.cpp.
References IND1, IZB, LOMASK, map, Position::posX, Position::posY, and testBounds().
Referenced by doIndustrial().
void Micropolis::setSpeed | ( | short | speed | ) |
Definition at line 176 of file utilities.cpp.
void Micropolis::setTile | ( | int | x, |
int | y, | ||
int | tile | ||
) |
Set a tile into the map.
x | X coordinate of the position to get, 0 to WORLD_W. |
y | Y coordinate of the position to get, 0 to WORLD_H. |
tile | the tile value to set. |
Definition at line 1174 of file micropolis.cpp.
References map, and testBounds().
void Micropolis::setTrafficDensity | ( | int | x, |
int | y, | ||
int | density | ||
) |
Set a value in the traffic density map.
x | X coordinate of the position to get, 0 to WORLD_W_2. |
y | Y coordinate of the position to get, 0 to WORLD_H_2. |
density | the value to set. |
Definition at line 1337 of file micropolis.cpp.
References Map< DATA, BLKSIZE >::set(), and trafficDensityMap.
|
private |
Definition at line 564 of file simulate.cpp.
References cityClass, cityScore, cityTax, clamp(), comCap, comHist, comPop, crimeAverage, gameLevel, indCap, indHist, indPop, landValueAverage, LENGTH_OF, LEVEL_COUNT, LEVEL_FIRST, LEVEL_LAST, max(), min(), miscHist, pollutionAverage, resCap, resHist, resPop, totalPop, and totalPopLast.
Referenced by doSimInit().
void Micropolis::setYear | ( | int | year | ) |
Definition at line 280 of file utilities.cpp.
|
private |
Copy the value of powerGridMap at position pos to the map.
pos | Position to copy. |
Definition at line 433 of file zone.cpp.
References LOMASK, map, NUCLEAR, Position::posX, Position::posY, powerGridMap, POWERPLANT, PWRBIT, and Map< DATA, BLKSIZE >::worldGet().
Referenced by doNilPower(), doZone(), and zonePlop().
void Micropolis::showBudgetWindowAndStartWaiting | ( | ) |
Definition at line 339 of file budget.cpp.
void Micropolis::showValves | ( | ) |
Definition at line 186 of file update.cpp.
|
private |
Definition at line 108 of file simulate.cpp.
|
private |
|
private |
Initialize for a simulation
Definition at line 716 of file micropolis.cpp.
References blinkFlag, changeEval(), cityTime, clearMap(), initGraphs(), initWillStuff(), LEVEL_EASY, mustUpdateOptions, resetEditorState(), resetMapState(), SC_NONE, scenario, setAutoBudget(), setAutoBulldoze(), setAutoGoto(), setEnableDisasters(), setEnableSound(), setFunds(), setGameLevelFunds(), simPass, simPasses, simPaused, and startingYear.
Referenced by init().
|
private |
Definition at line 440 of file simulate.cpp.
References CC_MEGALOPOLIS, CC_VILLAGE, cityClass, cityScore, cityTime, comCap, comPop, crimeAverage, disasterEvent, disasterWait, doNilPower(), doStartGame(), doStartScenario(), Map< DATA, BLKSIZE >::fill(), fireEffect, gameLevel, indCap, indPop, landValueAverage, LENGTH_OF, LEVEL_FIRST, LEVEL_LAST, MAX_FIRE_STATION_EFFECT, MAX_POLICE_STATION_EFFECT, MAX_ROAD_EFFECT, miscHist, policeEffect, pollutionAverage, powerGridMap, resCap, resPop, roadEffect, SC_COUNT, SC_NONE, scenario, scoreType, scoreWait, and setGameLevel().
Referenced by doSimInit().
|
private |
Definition at line 982 of file micropolis.cpp.
int Micropolis::simRandom | ( | ) |
Draw a random number (internal function).
Definition at line 98 of file random.cpp.
Referenced by getRandom16().
void Micropolis::simTick | ( | ) |
Move simulaton forward.
Definition at line 1014 of file micropolis.cpp.
References simPass, simPasses, and simUpdate().
|
private |
Definition at line 132 of file simulate.cpp.
void Micropolis::simulateRobots | ( | ) |
Definition at line 1025 of file micropolis.cpp.
void Micropolis::simUpdate | ( | ) |
Update ????
Definition at line 754 of file micropolis.cpp.
References blinkFlag, graphDoer(), heatSteps, scoreDoer(), tickCount(), tilesAnimated, and updateBudget().
Referenced by generateSomeCity(), and simTick().
|
private |
Definition at line 361 of file generate.cpp.
|
private |
Definition at line 416 of file generate.cpp.
|
private |
Temporary function to prevent breaking a lot of code.
Definition at line 429 of file generate.cpp.
References ToolEffects::modifyWorld(), and smoothTreesAt().
Referenced by putDownForest(), and smoothTreesAt().
|
private |
Smooth trees at a position.
Definition at line 441 of file generate.cpp.
References ToolEffects::getMapValue(), ToolEffects::setMapValue(), and testBounds().
|
private |
Definition at line 670 of file generate.cpp.
void Micropolis::spend | ( | int | dollars | ) |
Deduct dollars from the player funds.
dollars | Amount of money spent. |
Definition at line 1035 of file micropolis.cpp.
References setFunds(), and totalFunds.
Referenced by doBudgetNow(), and ToolEffects::modifyWorld().
bool Micropolis::spriteNotInBounds | ( | SimSprite * | sprite | ) |
Check whether a sprite is still entirely on-map.
sprite | Sprite to check. |
Definition at line 459 of file sprite.cpp.
References WORLD_H, SimSprite::x, SimSprite::xHot, SimSprite::y, and SimSprite::yHot.
Referenced by doAirplaneSprite(), doShipSprite(), and doTornadoSprite().
void Micropolis::startFire | ( | int | x, |
int | y | ||
) |
Start a fire at a single tile.
x | X coordinate in map coordinate. |
y | Y coordinate in map coordinate. |
Definition at line 1805 of file sprite.cpp.
References BURNBIT, DIRT, LOMASK, map, randomFire(), testBounds(), and ZONEBIT.
Referenced by doExplosionSprite().
void Micropolis::startFireInZone | ( | int | Xloc, |
int | Yloc, | ||
int | ch | ||
) |
Start a fire in a zone.
Xloc | X coordinate in map coordinate. |
Yloc | Y coordinate in map coordinate. |
ch | Map character at (Xloc, Yloc). |
Definition at line 1764 of file sprite.cpp.
References BULLBIT, clamp(), LOMASK, map, PORTBASE, rateOfGrowthMap, testBounds(), Map< DATA, BLKSIZE >::worldGet(), and Map< DATA, BLKSIZE >::worldSet().
Referenced by destroyMapTile().
|
private |
Take monthly snaphsot of all relevant data for the historic graphs. Also update variables that control building new churches and hospitals.
Rename to takeMonthlyCensus (or takeMonthlySnaphshot?).
A lot of this max stuff is also done in graph.cpp
Definition at line 730 of file simulate.cpp.
References changeCensus(), churchPop, clamp(), comHist, comHist10Max, comPop, crimeAverage, crimeHist, faith, graph10Max, hospitalPop, indHist, indHist10Max, indPop, max(), min(), moneyHist, needChurch, needHospital, pollutionAverage, pollutionHist, resHist, resHist10Max, and resPop.
|
private |
Definition at line 807 of file simulate.cpp.
|
private |
Can the tile be auto-bulldozed?.
tileValue | Value of the tile. |
True
if the tile can be auto-bulldozed, else false
. Definition at line 535 of file tool.cpp.
Referenced by canDriveOn(), prepareBuildingSite(), and putDownNetwork().
|
inlinestatic |
Check that the given coordinate is within world bounds
wx | World x coordinate |
wy | World y coordinate |
Definition at line 2386 of file micropolis.h.
References WORLD_H.
Referenced by buildHouse(), bulldozerTool(), canDriveOn(), connectTile(), destroyMapTile(), doBridge(), doBRiver(), doFire(), doFlood(), doMeltdown(), doResOut(), doShipSprite(), doSRiver(), evalLot(), findPerimeterRoad(), findPerimeterTelecom(), fireZone(), forestTool(), getChar(), getTile(), landTool(), makeExplosion(), makeFlood(), networkTool(), parkTool(), putDownForest(), putOnMap(), putRubble(), queryTool(), railroadTool(), repairZone(), roadTool(), setSmoke(), setTile(), smoothTreesAt(), startFire(), startFireInZone(), wireTool(), and zonePlop().
|
private |
Check at position pos for a power-less conducting tile in the direction testDir.
pos | Position to start from. |
testDir | Direction to investigate. |
Definition at line 104 of file power.cpp.
References CONDBIT, map, Position::move(), Position::posX, Position::posY, powerGridMap, and Map< DATA, BLKSIZE >::worldGet().
Referenced by doPowerScan().
Quad Micropolis::tickCount | ( | ) |
Get number of ticks.
time.tv_usec
should be divided to get seconds or time.tc_sec
should be multiplied. Definition at line 1061 of file micropolis.cpp.
Referenced by simUpdate().
void Micropolis::toolDown | ( | EditingTool | tool, |
short | tileX, | ||
short | tileY | ||
) |
Definition at line 1509 of file tool.cpp.
References doTool(), invalidateMaps(), makeSound(), MESSAGE_BULLDOZE_AREA_FIRST, MESSAGE_NOT_ENOUGH_FUNDS, NOWHERE, sendMessage(), simPass, TOOLRESULT_NEED_BULLDOZE, and TOOLRESULT_NO_MONEY.
void Micropolis::toolDrag | ( | EditingTool | tool, |
short | fromX, | ||
short | fromY, | ||
short | toX, | ||
short | toY | ||
) |
Drag a tool from (fromX, fromY) to (toX, toY).
tool | Tool being dragged. |
fromX | Horizontal coordinate of the starting position. |
fromY | Vertical coordinate of the starting position. |
toX | Horizontal coordinate of the ending position. |
toY | Vertical coordinate of the ending position. |
Definition at line 1538 of file tool.cpp.
References absoluteValue(), doTool(), gToolSize, invalidateMaps(), min(), and simPass.
void Micropolis::treeSplash | ( | short | xloc, |
short | yloc | ||
) |
Splash a bunch of trees down near (xloc, yloc).
Amount of trees is controlled by Micropolis::terrainTreeLevel.
xloc | Horizontal position of starting point for splashing trees. |
yloc | Vertical position of starting point for splashing trees. |
Definition at line 310 of file generate.cpp.
References DIR2_NORTH, DIRT, getRandom(), LOMASK, map, Position::move(), Position::posX, Position::posY, terrainTreeLevel, and Position::testBounds().
Referenced by doTrees().
Try to drive to a destination.
startPos | Starting position. |
destZone | Zonetype to drive to. |
Definition at line 309 of file traffic.cpp.
References curMapStackPointer, DIR2_INVALID, driveDone(), MAX_TRAFFIC_DISTANCE, Position::move(), pushPos(), rotate180(), and tryGo().
Referenced by makeTraffic(), and makeTrafficAt().
|
private |
Try to drive one tile in a random direction.
pos | Current position. |
dirLast | Forbidden direction for movement (to prevent reversing). |
DIR2_INVALID
is returned if not moved. Definition at line 356 of file traffic.cpp.
References DIR2_INVALID, DIR2_NORTH, DIRT, getRandom16(), getTileFromMap(), roadTest(), and rotate90().
Referenced by tryDrive().
bool Micropolis::tryOther | ( | int | Tpoo, |
int | Told, | ||
int | Tnew | ||
) |
???
Figure out what this function is doing.
Remove local magic constants and document the code.
Definition at line 431 of file sprite.cpp.
Referenced by doShipSprite().
short Micropolis::turnTo | ( | int | p, |
int | d | ||
) |
Turn.
p | Present direction (1..8). |
d | Destination direction (1..8). |
Definition at line 396 of file sprite.cpp.
Referenced by doAirplaneSprite(), doCopterSprite(), and doShipSprite().
void Micropolis::updateBudget | ( | ) |
The scripting language should pull these raw values out and format them, instead of the callback pushing them out.
Definition at line 327 of file budget.cpp.
References callback, and mustDrawBudget.
Referenced by simUpdate().
void Micropolis::updateDate | ( | ) |
Definition at line 159 of file update.cpp.
References callback, cityMonth, cityTime, cityYear, MESSAGE_NOT_ENOUGH_POWER, NOWHERE, sendMessage(), and startingYear.
void Micropolis::updateEvaluation | ( | ) |
Definition at line 110 of file update.cpp.
void Micropolis::updateFundEffects | ( | ) |
Update effects of (possibly reduced) funding
It updates effects with respect to roads, police, and fire.
Definition at line 912 of file simulate.cpp.
References fireEffect, fireFund, fireSpend, MAX_FIRE_STATION_EFFECT, MAX_POLICE_STATION_EFFECT, MAX_ROAD_EFFECT, mustDrawBudget, policeEffect, policeFund, policeSpend, roadEffect, roadFund, and roadSpend.
void Micropolis::updateFunds | ( | ) |
Set a flag that the funds display is out of date.
Definition at line 127 of file update.cpp.
Referenced by generateSomeCity(), loadScenario(), ToolEffects::modifyWorld(), and setFunds().
void Micropolis::updateGameLevel | ( | ) |
Report to the front-end that a new game level has been set.
Definition at line 244 of file utilities.cpp.
References callback, and gameLevel.
Referenced by setGameLevel().
void Micropolis::updateGraphs | ( | ) |
Definition at line 104 of file update.cpp.
void Micropolis::updateHeads | ( | ) |
Definition at line 116 of file update.cpp.
void Micropolis::updateMaps | ( | ) |
Definition at line 97 of file update.cpp.
void Micropolis::updateOptions | ( | ) |
Definition at line 248 of file update.cpp.
void Micropolis::updateUserInterface | ( | ) |
Definition at line 261 of file update.cpp.
|
private |
Vote on the problems of the city.
problemTable | Storage of how bad each problem is. |
Definition at line 288 of file evaluate.cpp.
References getRandom(), and problemVotes.
Referenced by doProblems().
|
private |
Is tile vulnerable for an earthquake?
tem | Tile data |
true
if tile is vulnerable, and false
if not Definition at line 330 of file disasters.cpp.
References LASTZONE, LOMASK, and ZONEBIT.
Referenced by makeEarthquake().
|
private |
|
private |
Build a wire at a tile.
x | Horizontal position of the tile to wire. |
y | Vertical position of the tile to wire. |
effects | Storage of effects of wiring the tile. |
Definition at line 1172 of file tool.cpp.
References ToolEffects::addFrontendMessage(), CONNECT_TILE_WIRE, connectTile(), testBounds(), TOOLRESULT_FAILED, and TOOLRESULT_OK.
Referenced by doTool().
|
private |
Put down a 3x3 zone around the center tile at pos..
base | Tile number of the top-left tile. |
Definition at line 366 of file zone.cpp.
References BULLBIT, LOMASK, map, Position::posX, Position::posY, setZonePower(), testBounds(), and ZONEBIT.
Referenced by comPlop(), doComOut(), doHospitalChurch(), doIndOut(), indPlop(), makeHospital(), and resPlop().
|
private |
Definition at line 2243 of file micropolis.h.
short Micropolis::airportPop |
Airport population.
Definition at line 1056 of file micropolis.h.
Referenced by doSpecialZone(), getAssessedValue(), init(), and sendMessages().
bool Micropolis::autoBudget |
Enable auto budget
When enabled, the program will perform budgetting of the city
Definition at line 2338 of file micropolis.h.
Referenced by doBudgetNow(), init(), saveFile(), and setAutoBudget().
bool Micropolis::autoBulldoze |
Enable auto-bulldoze
When enabled, the game will silently clear tiles when the user builds something on non-clear and bulldozable tiles
Definition at line 2331 of file micropolis.h.
Referenced by connectTile(), init(), prepareBuildingSite(), saveFile(), and setAutoBulldoze().
bool Micropolis::autoGoto |
Enable auto goto
When enabled and an important event happens, the map display will jump to the location of the event
Definition at line 1969 of file micropolis.h.
Referenced by init(), saveFile(), and setAutoGoto().
short Micropolis::blinkFlag |
Definition at line 2363 of file micropolis.h.
Referenced by init(), simInit(), and simUpdate().
Callback* Micropolis::callback |
Callback interface.
Definition at line 955 of file micropolis.h.
Referenced by didLoadCity(), didLoadScenario(), didntLoadCity(), didntSaveCity(), didSaveCity(), didTool(), doAutoGoto(), doEarthquake(), doHospitalChurch(), doLoseGame(), doNewGame(), doSaveCityAs(), doScoreCard(), doShowZoneStatus(), doStartGame(), doStartScenario(), doWinGame(), generateSomeCity(), graphDoer(), invalidateMaps(), makeSound(), pause(), resume(), sendMessage(), setCleanCityName(), updateBudget(), updateDate(), and updateGameLevel().
void* Micropolis::callbackData |
Hook for scripting language to store scripted callback function. (i.e. a callable Python object.)
Definition at line 2371 of file micropolis.h.
emscripten::val Micropolis::callbackVal |
Definition at line 2365 of file micropolis.h.
short Micropolis::cashFlow |
Definition at line 2105 of file micropolis.h.
short Micropolis::categoryLast |
City class of last city class check.
Definition at line 1961 of file micropolis.h.
Referenced by checkGrowth(), and init().
|
private |
Definition at line 1944 of file micropolis.h.
|
private |
Definition at line 1942 of file micropolis.h.
bool Micropolis::censusChanged |
Census changed flag.
Need to redraw census dependent stuff.
Definition at line 1159 of file micropolis.h.
Referenced by changeCensus(), doSimInit(), graphDoer(), and init().
short Micropolis::churchPop |
Number of churches.
Definition at line 1024 of file micropolis.h.
Referenced by doHospitalChurch(), init(), and take10Census().
Quad Micropolis::cityAssessedValue |
City assessed value.
Depends on roadTotal, railTotal, policeStationPop, fireStationPop, hospitalPop, stadiumPop, seaportPop, airportPop, coalPowerPop, and nuclearPowerPop, and their respective values.
Definition at line 1594 of file micropolis.h.
Referenced by evalInit(), getAssessedValue(), and init().
short Micropolis::cityCenterX |
X coordinate of city center.
Definition at line 2052 of file micropolis.h.
Referenced by getCityCenterDistance(), init(), makeEarthquake(), and populationDensityScan().
short Micropolis::cityCenterY |
Y coordinate of city center.
Definition at line 2053 of file micropolis.h.
Referenced by getCityCenterDistance(), init(), makeEarthquake(), and populationDensityScan().
CityClass Micropolis::cityClass |
City class, affected by city population.
Definition at line 1596 of file micropolis.h.
Referenced by doPopNum(), doScenarioScore(), evalInit(), init(), setValves(), and simLoadInit().
std::string Micropolis::cityFileName |
Filename of the last loaded city.
Definition at line 1913 of file micropolis.h.
Referenced by generateSomeCity(), init(), loadCity(), loadScenario(), saveCity(), and saveCityAs().
Quad Micropolis::cityMonth |
City month, 4 time units per month.
Definition at line 1099 of file micropolis.h.
Referenced by init(), and updateDate().
Quad Micropolis::cityMonthLast |
Definition at line 2652 of file micropolis.h.
std::string Micropolis::cityName |
Name of the city.
Name of the city.
Definition at line 1918 of file micropolis.h.
Referenced by init(), saveCityAs(), and setCleanCityName().
Quad Micropolis::cityPop |
City population.
Depends of ResPop, ComPop and IndPop.
Definition at line 1577 of file micropolis.h.
Referenced by doPopNum(), evalInit(), getScore(), init(), and initWillStuff().
Quad Micropolis::cityPopDelta |
Change in the city population.
Depends on last cityPop.
Definition at line 1584 of file micropolis.h.
Referenced by doPopNum(), evalInit(), getScore(), and init().
Quad Micropolis::cityPopLast |
Population of last city class check.
Definition at line 1960 of file micropolis.h.
Referenced by checkGrowth(), and init().
short Micropolis::cityScore |
City score.
Affected by average of problems, residential cap, commercial cap, industrial cap, road effect, police effect, fire effect, residential valve, commercial valve, industrial valve, city population, delta city population, fires, tax rate, and unpowered zones.
Definition at line 1607 of file micropolis.h.
Referenced by doScenarioScore(), doVotes(), evalInit(), getScore(), init(), initWillStuff(), setValves(), and simLoadInit().
short Micropolis::cityScoreDelta |
Change in the city score.
Depends on city score.
Definition at line 1614 of file micropolis.h.
Referenced by evalInit(), getScore(), and init().
short Micropolis::cityTax |
City tax rate.
Definition at line 1226 of file micropolis.h.
Referenced by collectTax(), doProblems(), getScore(), init(), loadFile(), saveFile(), sendMessages(), and setValves().
short Micropolis::cityTaxAverage |
Definition at line 2120 of file micropolis.h.
Quad Micropolis::cityTime |
City time unit counter, increnented once every 16 runs through the simulator (at fast speed). A time unit is 7.6 days. 4 units per month, 48 units per year, relative to startingYear
Four units per month, so one unit is about a week (7.6 days).
Definition at line 1093 of file micropolis.h.
Referenced by checkGrowth(), currentYear(), doHospitalChurch(), doSpecialZone(), generateSomeCity(), init(), loadFile(), loadScenario(), saveFile(), sendMessages(), simInit(), simLoadInit(), and updateDate().
Quad Micropolis::cityTimeLast |
Definition at line 2648 of file micropolis.h.
Quad Micropolis::cityYear |
City year, (Micropolis::cityTime / 48) + Micropolis::startingYear.
Definition at line 1105 of file micropolis.h.
Referenced by init(), and updateDate().
Quad Micropolis::cityYearLast |
Definition at line 2650 of file micropolis.h.
short Micropolis::cityYes |
Yes votes.
Percentage of people who think the mayor is doing a good job.
Definition at line 1554 of file micropolis.h.
Referenced by cityEvaluation(), doVotes(), evalInit(), and init().
short Micropolis::coalPowerPop |
Coal power plant population.
Definition at line 1041 of file micropolis.h.
Referenced by doPowerScan(), doSpecialZone(), getAssessedValue(), init(), and sendMessages().
bool Micropolis::comCap |
Block commercial growth.
Definition at line 2102 of file micropolis.h.
Referenced by getScore(), init(), sendMessages(), setValves(), and simLoadInit().
short* Micropolis::comHist |
Commercial population history.
Definition at line 1348 of file micropolis.h.
Referenced by destroyMapArrays(), getHistory(), getHistoryRange(), initGraphMax(), initMapArrays(), loadFileData(), saveFile(), setHistory(), setValves(), and take10Census().
short Micropolis::comHist10Max |
10 year commercial history maximum value.
Definition at line 1137 of file micropolis.h.
Referenced by init(), initGraphMax(), and take10Census().
short Micropolis::comHist120Max |
120 year commercial history maximum value.
Definition at line 1142 of file micropolis.h.
Referenced by init(), and initGraphMax().
Quad Micropolis::comLast |
Definition at line 2658 of file micropolis.h.
short Micropolis::comPop |
Commercial zone population.
Depends on level of zone development.
Definition at line 990 of file micropolis.h.
Referenced by doCommercial(), getPopulation(), getUnemployment(), init(), sendMessages(), setValves(), simLoadInit(), and take10Census().
MapShort8 Micropolis::comRateMap |
Commercial rate map.
Depends on distance to city center. Affects commercial zone evaluation.
Definition at line 1332 of file micropolis.h.
Referenced by computeComRateMap(), evalCom(), init(), and initWillStuff().
short Micropolis::comValve |
Definition at line 2135 of file micropolis.h.
short Micropolis::comZonePop |
Number of commercial zones.
Definition at line 1015 of file micropolis.h.
Referenced by doCommercial(), init(), and sendMessages().
short Micropolis::crimeAverage |
Average crime.
Affected by land value, population density, police station distance.
Definition at line 1064 of file micropolis.h.
Referenced by crimeScan(), doProblems(), doScenarioScore(), init(), sendMessages(), setValves(), simLoadInit(), and take10Census().
short* Micropolis::crimeHist |
Crime history.
Definition at line 1368 of file micropolis.h.
Referenced by destroyMapArrays(), getHistory(), getHistoryRange(), initMapArrays(), loadFileData(), saveFile(), setHistory(), and take10Census().
short Micropolis::crimeMaxX |
X coordinate of most criminal area. Not used.
Definition at line 2058 of file micropolis.h.
Referenced by crimeScan(), and init().
short Micropolis::crimeMaxY |
Y coordinate of most criminal area. Not used.
Definition at line 2059 of file micropolis.h.
Referenced by crimeScan(), and init().
short Micropolis::crimeRamp |
Definition at line 2097 of file micropolis.h.
MapByte2 Micropolis::crimeRateMap |
Crime rate map.
Definition at line 1250 of file micropolis.h.
Referenced by crimeScan(), destroyMapArrays(), getCrimeRate(), getCrimeRateMapBuffer(), getDensity(), init(), initWillStuff(), and setCrimeRate().
|
private |
Position stack top pointer, points to top position.
Definition at line 2610 of file micropolis.h.
Referenced by addToTrafficDensityMap(), init(), makeTraffic(), pullPos(), pushPos(), and tryDrive().
|
private |
Scenario Micropolis::disasterEvent |
The disaster for which a count-down is running.
Definition at line 2109 of file micropolis.h.
Referenced by doDisasters(), init(), initWillStuff(), scenarioDisaster(), and simLoadInit().
short Micropolis::disasterWait |
Count-down timer for the disaster.
Definition at line 2110 of file micropolis.h.
Referenced by init(), scenarioDisaster(), and simLoadInit().
bool Micropolis::doAnimation |
Enable animation.
true
. Should connect it to a frontend option. Definition at line 1888 of file micropolis.h.
Referenced by destroyMapTile(), init(), putRubble(), and setDoAnimation().
bool Micropolis::doInitialEval |
Need to perform initial city evaluation.
Definition at line 2128 of file micropolis.h.
Referenced by doSimInit(), generateSomeCity(), init(), loadFile(), and loadScenario().
bool Micropolis::doMessages |
Definition at line 1890 of file micropolis.h.
Referenced by init(), and setDoMessages().
Quad Micropolis::donDither |
Integer with bits 0..2 that control smoothing.
Definition at line 2064 of file micropolis.h.
Referenced by init().
bool Micropolis::doNotices |
Definition at line 1892 of file micropolis.h.
Referenced by init(), and setDoNotices().
bool Micropolis::enableDisasters |
Enable disasters.
Definition at line 2354 of file micropolis.h.
Referenced by doAirplaneSprite(), doBusSprite(), doDisasters(), doSpecialZone(), init(), and setEnableDisasters().
bool Micropolis::enableSound |
Enable sound.
Definition at line 2352 of file micropolis.h.
Referenced by init(), makeSound(), saveFile(), and setEnableSound().
bool Micropolis::evalChanged |
The evaluation window should be shown to the user.
Definition at line 2358 of file micropolis.h.
Referenced by changeEval(), init(), and scoreDoer().
float Micropolis::externalMarket |
Definition at line 2107 of file micropolis.h.
short Micropolis::faith |
Quad Micropolis::fireEffect |
Ratio of fire spending over fire funding, times MAX_FIRE_EFFECT.
Definition at line 1213 of file micropolis.h.
Referenced by collectTax(), doSpecialZone(), getScore(), init(), initWillStuff(), sendMessages(), simLoadInit(), and updateFundEffects().
Quad Micropolis::fireFund |
Requested funds for fire stations.
Depends on fire station population.
Definition at line 1198 of file micropolis.h.
Referenced by collectTax(), doBudgetNow(), init(), initWillStuff(), and updateFundEffects().
float Micropolis::firePercent |
Percentage of requested fire station costs to funding level.
Value between 0
and MAX_FIRESTATION_EFFECT. Affected by road funds slider and budgetary constraints.
Definition at line 1446 of file micropolis.h.
Referenced by doBudgetNow(), init(), loadFile(), and saveFile().
short Micropolis::firePop |
Number of fires.
Definition at line 976 of file micropolis.h.
Referenced by getFireSeverity(), and init().
Quad Micropolis::fireSpend |
Spending on fire stations.
Definition at line 1177 of file micropolis.h.
Referenced by doBudgetNow(), init(), and updateFundEffects().
MapShort8 Micropolis::fireStationEffectMap |
Copy of fire station map to display.
Definition at line 1308 of file micropolis.h.
Referenced by doFire(), fireAnalysis(), getFireCoverage(), getFireCoverageMapBuffer(), init(), initWillStuff(), and setFireCoverage().
MapShort8 Micropolis::fireStationMap |
Fire station map.
Effectivity of fire control in this area.
Affected by fire stations, powered, fire funding ratio, road access. Affects how long fires burn.
Definition at line 1303 of file micropolis.h.
Referenced by doSpecialZone(), fireAnalysis(), init(), and initWillStuff().
short Micropolis::fireStationPop |
Fire station population.
Definition at line 1036 of file micropolis.h.
Referenced by collectTax(), doSpecialZone(), getAssessedValue(), init(), and sendMessages().
Quad Micropolis::fireValue |
Amount of fire station funding granted.
Definition at line 1461 of file micropolis.h.
Referenced by doBudgetNow(), and init().
short Micropolis::floodCount |
Size of flooding disaster.
Definition at line 1515 of file micropolis.h.
Referenced by doDisasters(), doFlood(), init(), and makeFlood().
|
private |
Pool of free SimSprite objects.
Definition at line 2239 of file micropolis.h.
Referenced by destroySprite(), init(), and newSprite().
GameLevel Micropolis::gameLevel |
Difficulty level of the game (0..2)
Definition at line 2342 of file micropolis.h.
Referenced by collectTax(), doDisasters(), doSpecialZone(), init(), setGameLevel(), setValves(), simLoadInit(), and updateGameLevel().
int Micropolis::generatedCitySeed |
The seed of the most recently generated city.
Definition at line 1743 of file micropolis.h.
Referenced by generateMap().
|
private |
Definition at line 2241 of file micropolis.h.
short Micropolis::graph10Max |
Definition at line 1808 of file micropolis.h.
Referenced by init(), initGraphMax(), and take10Census().
short Micropolis::graph120Max |
Definition at line 1813 of file micropolis.h.
Referenced by init(), and initGraphMax().
int Micropolis::heatFlow |
int Micropolis::heatRule |
int Micropolis::heatSteps |
int Micropolis::heatWrap |
bool Micropolis::historyInitialized |
Definition at line 1803 of file micropolis.h.
Referenced by initGraphs().
short Micropolis::hospitalPop |
Number of hospitals.
Definition at line 1023 of file micropolis.h.
Referenced by doHospitalChurch(), getAssessedValue(), init(), and take10Census().
bool Micropolis::indCap |
Block industrial growth.
Definition at line 2103 of file micropolis.h.
Referenced by getScore(), init(), sendMessages(), setValves(), and simLoadInit().
short* Micropolis::indHist |
Industrial population history.
Definition at line 1353 of file micropolis.h.
Referenced by destroyMapArrays(), getHistory(), getHistoryRange(), initGraphMax(), initMapArrays(), loadFileData(), saveFile(), setHistory(), setValves(), and take10Census().
short Micropolis::indHist10Max |
10 year industrial history maximum value.
Definition at line 1147 of file micropolis.h.
Referenced by init(), initGraphMax(), and take10Census().
short Micropolis::indHist120Max |
120 year industrial history maximum value.
Definition at line 1152 of file micropolis.h.
Referenced by init(), and initGraphMax().
Quad Micropolis::indLast |
Definition at line 2660 of file micropolis.h.
short Micropolis::indPop |
Industrial zone population.
Depends on level of zone development.
Definition at line 997 of file micropolis.h.
Referenced by doIndustrial(), getPopulation(), getUnemployment(), init(), sendMessages(), setValves(), simLoadInit(), and take10Census().
short Micropolis::indValve |
Definition at line 2136 of file micropolis.h.
short Micropolis::indZonePop |
Number of industrial zones.
Definition at line 1016 of file micropolis.h.
Referenced by doIndustrial(), init(), and sendMessages().
short Micropolis::initSimLoad |
Definition at line 2344 of file micropolis.h.
short Micropolis::landValueAverage |
Land value average.
Affected by distance from city center, development density (terrainMem), pollution, and crime.
Definition at line 1081 of file micropolis.h.
Referenced by collectTax(), doProblems(), init(), setValves(), and simLoadInit().
MapByte2 Micropolis::landValueMap |
Land value map.
Definition at line 1249 of file micropolis.h.
Referenced by crimeScan(), destroyMapArrays(), doComIn(), evalRes(), getDensity(), getLandPollutionValue(), getLandValue(), getLandValueMapBuffer(), getTrafficAverage(), init(), initWillStuff(), and setLandValue().
unsigned short* Micropolis::map[WORLD_W] |
Two-dimensional array of map tiles.
Map[0 <= x < 120][0 <= y < 100]
Definition at line 1121 of file micropolis.h.
Referenced by addToTrafficDensityMap(), buildHouse(), canDriveOn(), clearMap(), clearUnnatural(), coalSmoke(), destroyMapArrays(), destroyMapTile(), doBridge(), doCommercial(), doFire(), doFlood(), doFreePop(), doHospitalChurch(), doIndustrial(), doMeltdown(), doNilPower(), doRadTile(), doRail(), doResidential(), doResIn(), doResOut(), doRoad(), doShipSprite(), doSpecialZone(), doZone(), doZoneStatus(), drawStadium(), driveDone(), evalLot(), findPerimeterRoad(), findPerimeterTelecom(), fireZone(), generateShip(), getChar(), ToolEffects::getMapValue(), getTile(), getTileFromMap(), initMapArrays(), makeEarthquake(), makeFire(), makeFlood(), makeMeltdown(), makeMonster(), makeNakedIsland(), ToolEffects::modifyWorld(), populationDensityScan(), putOnMap(), repairZone(), saveFile(), setFire(), setSmoke(), setTile(), setZonePower(), simHeat(), startFire(), startFireInZone(), testForConductive(), treeSplash(), and zonePlop().
|
private |
Memory for map array.
Definition at line 1398 of file micropolis.h.
Referenced by destroyMapArrays(), getMapBuffer(), initMapArrays(), and loadFileData().
int Micropolis::mapSerial |
The invalidateMaps method increases the map serial number every time the maps changes.
Definition at line 2130 of file micropolis.h.
Referenced by init(), and invalidateMaps().
short Micropolis::messageNumber |
Definition at line 2356 of file micropolis.h.
Quad Micropolis::messageTimeLast |
Definition at line 2340 of file micropolis.h.
short* Micropolis::miscHist |
Memory used to save miscelaneous game values in save file.
Definition at line 1373 of file micropolis.h.
Referenced by destroyMapArrays(), initMapArrays(), loadFile(), loadFileData(), saveFile(), setValves(), and simLoadInit().
short* Micropolis::moneyHist |
Money history.
Definition at line 1358 of file micropolis.h.
Referenced by destroyMapArrays(), getHistory(), getHistoryRange(), initMapArrays(), loadFileData(), saveFile(), setHistory(), and take10Census().
unsigned short* Micropolis::mop[WORLD_W] |
Definition at line 1122 of file micropolis.h.
|
private |
Definition at line 1399 of file micropolis.h.
int Micropolis::mustDrawBudget |
Flag set when budget window needs to be updated.
Definition at line 1466 of file micropolis.h.
Referenced by doBudgetNow(), init(), updateBudget(), and updateFundEffects().
bool Micropolis::mustUpdateFunds |
Definition at line 2644 of file micropolis.h.
bool Micropolis::mustUpdateOptions |
Options displayed at user need updating.
Definition at line 2646 of file micropolis.h.
Referenced by doBudgetNow(), init(), loadFile(), setAutoBudget(), setAutoBulldoze(), setAutoGoto(), setDoAnimation(), setDoMessages(), setDoNotices(), setEnableDisasters(), setEnableSound(), and simInit().
|
private |
Need church?
0 if no, 1 if yes, -1 if too many.
Definition at line 1392 of file micropolis.h.
Referenced by doHospitalChurch(), init(), makeHospital(), and take10Census().
|
private |
Need hospital?
0 if no, 1 if yes, -1 if too many.
Definition at line 1385 of file micropolis.h.
Referenced by doHospitalChurch(), init(), makeHospital(), and take10Census().
short Micropolis::newMap |
Definition at line 2047 of file micropolis.h.
Referenced by doSimInit(), and init().
short Micropolis::newMapFlags[MAP_TYPE_COUNT] |
Definition at line 2050 of file micropolis.h.
Referenced by crimeScan(), fireAnalysis(), init(), and populationDensityScan().
bool Micropolis::newPower |
Definition at line 2118 of file micropolis.h.
UQuad Micropolis::nextRandom |
Definition at line 2025 of file micropolis.h.
short Micropolis::nuclearPowerPop |
Nuclear power plant population.
Definition at line 1046 of file micropolis.h.
Referenced by doPowerScan(), doSpecialZone(), getAssessedValue(), init(), and sendMessages().
short Micropolis::phaseCycle |
Definition at line 2124 of file micropolis.h.
Quad Micropolis::policeEffect |
Ratio of police spending over police funding, times MAX_POLICE_EFFECT.
Definition at line 1208 of file micropolis.h.
Referenced by collectTax(), doSpecialZone(), getScore(), init(), initWillStuff(), sendMessages(), simLoadInit(), and updateFundEffects().
Quad Micropolis::policeFund |
Requested funds for police stations.
Depends on police station population.
Definition at line 1191 of file micropolis.h.
Referenced by collectTax(), doBudgetNow(), init(), initWillStuff(), and updateFundEffects().
float Micropolis::policePercent |
Percentage of requested police station costs to funding level.
Value between 0
and MAX_POLICESTATION_EFFECT. Affected by road funds slider and budgetary constraints.
Definition at line 1438 of file micropolis.h.
Referenced by doBudgetNow(), init(), loadFile(), and saveFile().
Quad Micropolis::policeSpend |
Spending on police stations.
Definition at line 1172 of file micropolis.h.
Referenced by doBudgetNow(), init(), and updateFundEffects().
MapShort8 Micropolis::policeStationEffectMap |
Copy of police station map to display.
Definition at line 1324 of file micropolis.h.
Referenced by crimeScan(), getPoliceCoverage(), getPoliceCoverageMapBuffer(), init(), initWillStuff(), and setPoliceCoverage().
MapShort8 Micropolis::policeStationMap |
Police station map.
Effectivity of police in fighting crime.
Affected by police stations, powered, police funding ratio, road access. Affects crime rate.
Definition at line 1319 of file micropolis.h.
Referenced by crimeScan(), doSpecialZone(), init(), and initWillStuff().
short Micropolis::policeStationPop |
Police station population.
Definition at line 1031 of file micropolis.h.
Referenced by collectTax(), doSpecialZone(), getAssessedValue(), init(), and sendMessages().
Quad Micropolis::policeValue |
Amount of police funding granted.
Definition at line 1456 of file micropolis.h.
Referenced by doBudgetNow(), and init().
short Micropolis::pollutionAverage |
Average pollution.
Affected by PollutionMem, which is effected by traffic, fire, radioactivity, industrial zones, seaports, airports, power plants.
Definition at line 1073 of file micropolis.h.
Referenced by doDisasters(), doProblems(), init(), sendMessages(), setValves(), simLoadInit(), and take10Census().
MapByte2 Micropolis::pollutionDensityMap |
Pollution density map.
Definition at line 1248 of file micropolis.h.
Referenced by destroyMapArrays(), doResIn(), evalRes(), getDensity(), getLandPollutionValue(), getPollutionDensity(), getPollutionDensityMapBuffer(), init(), initWillStuff(), and setPollutionDensity().
short* Micropolis::pollutionHist |
Pollution history.
Definition at line 1363 of file micropolis.h.
Referenced by destroyMapArrays(), getHistory(), getHistoryRange(), initMapArrays(), loadFileData(), saveFile(), setHistory(), and take10Census().
short Micropolis::pollutionMaxX |
X coordinate of most polluted area.
Definition at line 2055 of file micropolis.h.
Referenced by init(), initSprite(), and makeMonster().
short Micropolis::pollutionMaxY |
Y coordinate of most polluted area.
Definition at line 2056 of file micropolis.h.
Referenced by init(), initSprite(), and makeMonster().
short Micropolis::pollutionRamp |
Definition at line 2099 of file micropolis.h.
MapByte2 Micropolis::populationDensityMap |
Population density map.
Definition at line 1246 of file micropolis.h.
Referenced by crimeScan(), destroyMapArrays(), doResIn(), getDensity(), getPopulationDensity(), getPopulationDensityMapBuffer(), init(), initWillStuff(), populationDensityScan(), and setPopulationDensity().
short Micropolis::poweredZoneCount |
Number of powered tiles in all zone.
Definition at line 2115 of file micropolis.h.
Referenced by doZone(), getScore(), init(), and sendMessages().
MapByte1 Micropolis::powerGridMap |
Power grid map.
Definition at line 1283 of file micropolis.h.
Referenced by doPowerScan(), getPowerGrid(), getPowerGridMapBuffer(), init(), setPowerGrid(), setZonePower(), simLoadInit(), and testForConductive().
|
private |
Stack counter, points to top-most item.
Definition at line 2002 of file micropolis.h.
Referenced by doPowerScan(), init(), pullPowerStack(), and pushPowerStack().
|
private |
Stack of X/Y positions for traversing setting the power grid.
Definition at line 2005 of file micropolis.h.
Referenced by init(), pullPowerStack(), and pushPowerStack().
short Micropolis::problemOrder[CVP_PROBLEM_COMPLAINTS] |
Order of taken problems.
Contains index of MicropolisEngine::problemVotes of taken problems, in decreasing order.
Definition at line 1570 of file micropolis.h.
Referenced by countProblems(), doProblems(), evalInit(), getProblemNumber(), getProblemVotes(), and init().
short Micropolis::problemVotes[PROBNUM] |
Problem votes.
The number of votes for each problem.
Definition at line 1562 of file micropolis.h.
Referenced by doProblems(), evalInit(), getProblemVotes(), init(), and voteProblems().
short Micropolis::railTotal |
Total number of rails.
No penalty for bridges or high traffic density.
Definition at line 971 of file micropolis.h.
Referenced by collectTax(), doRail(), getAssessedValue(), init(), and sendMessages().
MapShort8 Micropolis::rateOfGrowthMap |
Rate of growth map.
Affected by DecROGMem, incROG called by zones. Decreased by fire explosions from sprites, fire spreading. Doesn't seem to actually feed back into the simulation. Output only.
Definition at line 1292 of file micropolis.h.
Referenced by decRateOfGrowthMap(), fireZone(), getDensity(), getRateOfGrowth(), getRateOfGrowthMapBuffer(), incRateOfGrowth(), init(), initWillStuff(), setRateOfGrowth(), and startFireInZone().
bool Micropolis::resCap |
Block residential growth.
Definition at line 2101 of file micropolis.h.
Referenced by getScore(), init(), sendMessages(), setValves(), and simLoadInit().
short* Micropolis::resHist |
Residential population history.
Definition at line 1343 of file micropolis.h.
Referenced by destroyMapArrays(), getHistory(), getHistoryRange(), initGraphMax(), initMapArrays(), loadFileData(), saveFile(), setHistory(), setValves(), and take10Census().
short Micropolis::resHist10Max |
10 year residential history maximum value.
Definition at line 1127 of file micropolis.h.
Referenced by init(), initGraphMax(), and take10Census().
short Micropolis::resHist120Max |
120 year residential history maximum value.
Definition at line 1132 of file micropolis.h.
Referenced by init(), and initGraphMax().
Quad Micropolis::resLast |
Definition at line 2656 of file micropolis.h.
short Micropolis::resPop |
Number of people in the residential zones.
Depends on level of zone development.
Definition at line 983 of file micropolis.h.
Referenced by doResidential(), getPopulation(), getUnemployment(), init(), sendMessages(), setValves(), simLoadInit(), and take10Census().
short Micropolis::resValve |
Definition at line 2134 of file micropolis.h.
short Micropolis::resZonePop |
Number of residential zones.
Definition at line 1014 of file micropolis.h.
Referenced by doResidential(), init(), and sendMessages().
Quad Micropolis::roadEffect |
Ratio of road spending over road funding, times MAX_ROAD_EFFECT.
Definition at line 1203 of file micropolis.h.
Referenced by collectTax(), doRail(), doRoad(), getScore(), init(), initWillStuff(), sendMessages(), simLoadInit(), and updateFundEffects().
Quad Micropolis::roadFund |
Requested funds for roads.
Depends on number of roads, rails, and game level.
Definition at line 1184 of file micropolis.h.
Referenced by collectTax(), doBudgetNow(), init(), initWillStuff(), and updateFundEffects().
float Micropolis::roadPercent |
Percentage of requested road and rail costs to funding level.
Value between 0
and MAX_ROAD_EFFECT. Affected by road funds slider and budgetary constraints.
Definition at line 1430 of file micropolis.h.
Referenced by doBudgetNow(), init(), loadFile(), and saveFile().
Quad Micropolis::roadSpend |
Spending on roads.
Definition at line 1167 of file micropolis.h.
Referenced by doBudgetNow(), init(), and updateFundEffects().
short Micropolis::roadTotal |
Number of road tiles in the game.
Bridges count as 4 tiles, and high density traffic counts as 2 tiles.
Definition at line 964 of file micropolis.h.
Referenced by collectTax(), doRoad(), getAssessedValue(), init(), and sendMessages().
Quad Micropolis::roadValue |
Amount of road funding granted.
Definition at line 1451 of file micropolis.h.
Referenced by doBudgetNow(), and init().
Scenario Micropolis::scenario |
Scenario being played.
Definition at line 2346 of file micropolis.h.
Referenced by doShipSprite(), doStartScenario(), generateSomeCity(), init(), loadFile(), loadScenario(), sendMessages(), simInit(), and simLoadInit().
Scenario Micropolis::scoreType |
The type of score table to use.
Definition at line 2112 of file micropolis.h.
Referenced by init(), sendMessages(), and simLoadInit().
short Micropolis::scoreWait |
Time to wait before computing the score.
Definition at line 2113 of file micropolis.h.
Referenced by init(), sendMessages(), and simLoadInit().
short Micropolis::seaportPop |
Seaport population.
Definition at line 1051 of file micropolis.h.
Referenced by doSpecialZone(), getAssessedValue(), init(), and sendMessages().
short Micropolis::simCycle |
Definition at line 2122 of file micropolis.h.
int Micropolis::simLoops |
Definition at line 1862 of file micropolis.h.
int Micropolis::simPass |
The count of the current pass through the simulator loop.
Definition at line 1872 of file micropolis.h.
Referenced by init(), simInit(), simTick(), toolDown(), and toolDrag().
int Micropolis::simPasses |
The number of passes through the simulator loop to take each tick.
Definition at line 1867 of file micropolis.h.
bool Micropolis::simPaused |
int Micropolis::simPausedSpeed |
Definition at line 1880 of file micropolis.h.
short Micropolis::simSpeed |
Definition at line 2348 of file micropolis.h.
short Micropolis::simSpeedMeta |
Definition at line 2350 of file micropolis.h.
short Micropolis::speedCycle |
Definition at line 2126 of file micropolis.h.
|
private |
Definition at line 2245 of file micropolis.h.
SimSprite* Micropolis::spriteList |
List of active sprites.
Definition at line 2221 of file micropolis.h.
Referenced by destroyAllSprites(), destroySprite(), doAirplaneSprite(), doBusSprite(), doMonsterSprite(), doTornadoSprite(), getBoatDistance(), init(), moveObjects(), and newSprite().
short Micropolis::stadiumPop |
Number of stadiums.
Definition at line 1026 of file micropolis.h.
Referenced by doSpecialZone(), getAssessedValue(), init(), and sendMessages().
short Micropolis::startingYear |
City starting year.
Definition at line 1110 of file micropolis.h.
Referenced by currentYear(), init(), simInit(), and updateDate().
bool Micropolis::taxFlag |
Tax port flag.
Apparently never used. CollectTax checks it.
Apparently taxFlag is never set to true in MicropolisEngine or the TCL code.
Don should check old Mac code to see if it's ever set.
Variable is always 0
. Decide whether to keep it, and if yes, create means to modify its value
Definition at line 1239 of file micropolis.h.
Referenced by collectTax(), init(), and initWillStuff().
Quad Micropolis::taxFund |
Funds from taxes.
Depends on total population, average land value, city tax, and game level.
Definition at line 1221 of file micropolis.h.
Referenced by collectTax(), doBudgetNow(), and init().
MapByte2 Micropolis::tempMap1 |
Temporary map 1.
Used to smooth population density, pollution.
Definition at line 1264 of file micropolis.h.
Referenced by destroyMapArrays(), and populationDensityScan().
MapByte2 Micropolis::tempMap2 |
Temporary map 2.
Used to smooth population density, pollution.
Definition at line 1271 of file micropolis.h.
Referenced by destroyMapArrays(), and populationDensityScan().
MapByte4 Micropolis::tempMap3 |
Temporary map 3.
Used to smooth development density, for terrainDensityMap.
Definition at line 1278 of file micropolis.h.
Referenced by destroyMapArrays().
int Micropolis::terrainCreateIsland |
Controls how often to create an island. -1 => 10% chance of island, 0 => never create island, 1 => always create island
Definition at line 1738 of file micropolis.h.
Referenced by generateMap(), and init().
int Micropolis::terrainCurveLevel |
Controls the level of river curviness. -1 => default curve level, 0 => never create rivers, >0 => create curvier rivers
Definition at line 1732 of file micropolis.h.
Referenced by doBRiver(), doSRiver(), generateMap(), and init().
MapByte4 Micropolis::terrainDensityMap |
Terrain development density map.
Used to calculate land value.
Definition at line 1257 of file micropolis.h.
Referenced by destroyMapArrays(), init(), and initWillStuff().
int Micropolis::terrainLakeLevel |
Controls the level of lake creation. -1 => create default number of lakes, 0 => never create lakes, >0 => create more lakes
Definition at line 1726 of file micropolis.h.
Referenced by generateMap(), init(), and makeLakes().
int Micropolis::terrainTreeLevel |
Controls the level of tree creation. -1 => create default number of trees, 0 => never create trees, >0 => create more trees
Definition at line 1720 of file micropolis.h.
Referenced by doTrees(), generateMap(), init(), and treeSplash().
bool Micropolis::tilesAnimated |
Definition at line 1882 of file micropolis.h.
Referenced by init(), and simUpdate().
Quad Micropolis::totalFunds |
Funds of the player.
Definition at line 2323 of file micropolis.h.
Referenced by doBudgetNow(), init(), ToolEffects::modifyIfEnoughFunding(), saveFile(), setFunds(), and spend().
Quad Micropolis::totalFundsLast |
Definition at line 2654 of file micropolis.h.
short Micropolis::totalPop |
Total population.
Includes residential pop / 8 plus industrial pop plus commercial pop.
Definition at line 1005 of file micropolis.h.
Referenced by cityEvaluation(), collectTax(), doSimInit(), generateTrain(), init(), sendMessages(), and setValves().
short Micropolis::totalPopLast |
Last total population.
Not used?
Definition at line 1012 of file micropolis.h.
Referenced by init(), and setValves().
short Micropolis::totalZonePop |
Total zone population.
Definition at line 1021 of file micropolis.h.
Referenced by init(), and sendMessages().
short Micropolis::trafficAverage |
Average traffic.
Depends on average traffic density of tiles with non-zero land value.
Definition at line 1621 of file micropolis.h.
Referenced by doScenarioScore(), getTrafficAverage(), init(), and sendMessages().
MapByte2 Micropolis::trafficDensityMap |
Traffic density map.
Definition at line 1247 of file micropolis.h.
Referenced by addToTrafficDensityMap(), decTrafficMap(), destroyMapArrays(), doBusSprite(), doCopterSprite(), doRoad(), getTrafficAverage(), getTrafficDensity(), getTrafficDensityMapBuffer(), init(), initWillStuff(), and setTrafficDensity().
|
private |
X coordinate of a position with heavy traffic.
Definition at line 2613 of file micropolis.h.
Referenced by addToTrafficDensityMap(), and init().
|
private |
Y coordinate of a position with heavy traffic.
Definition at line 2614 of file micropolis.h.
Referenced by addToTrafficDensityMap(), and init().
short Micropolis::unpoweredZoneCount |
Number of unpowered tiles in all zones.
Definition at line 2116 of file micropolis.h.
Referenced by doZone(), getScore(), init(), and sendMessages().
void* Micropolis::userData |
Hook for scripting language to store context (i.e. peer object). (i.e. Python SWIG wrapper of this Micropolis object.)
Definition at line 2377 of file micropolis.h.
bool Micropolis::valveFlag |
Definition at line 2095 of file micropolis.h.