MicropolisEngine/src/micropolis.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <math.h>
#include <cstdarg>
#include <unistd.h>
#include <sys/time.h>
#include <sys/file.h>
#include <sys/types.h>
#include <string>
#include <vector>
#include <map>
#include "data_types.h"
#include "map_type.h"
#include "position.h"

Go to the source code of this file.

Classes

class  Resource
class  StringTable
class  SimSprite
class  Micropolis

Defines

#define IS_INTEL   1
#define MICROPOLIS_VERSION   "5.0"
#define LENGTH_OF(array)   (sizeof(array) / sizeof((array)[0]))
#define NOT_REACHED()   not_reached(__LINE__, __FILE__)

Typedefs

typedef unsigned short MapValue
typedef unsigned short MapTile
typedef void(* CallbackFunction )(Micropolis *micropolis, void *data, const char *name, const char *params, va_list arglist)

Enumerations

enum  HistoryType {
  HISTORY_TYPE_RES, HISTORY_TYPE_COM, HISTORY_TYPE_IND, HISTORY_TYPE_MONEY,
  HISTORY_TYPE_CRIME, HISTORY_TYPE_POLLUTION, HISTORY_TYPE_COUNT
}
enum  HistoryScale { HISTORY_SCALE_SHORT, HISTORY_SCALE_LONG, HISTORY_SCALE_COUNT }
enum  MapType {
  MAP_TYPE_ALL, MAP_TYPE_RES, MAP_TYPE_COM, MAP_TYPE_IND,
  MAP_TYPE_POWER, MAP_TYPE_ROAD, MAP_TYPE_POPULATION_DENSITY, MAP_TYPE_RATE_OF_GROWTH,
  MAP_TYPE_TRAFFIC_DENSITY, MAP_TYPE_POLLUTION, MAP_TYPE_CRIME, MAP_TYPE_LAND_VALUE,
  MAP_TYPE_FIRE_RADIUS, MAP_TYPE_POLICE_RADIUS, MAP_TYPE_DYNAMIC, MAP_TYPE_COUNT
}
enum  SpriteType {
  SPRITE_NOTUSED = 0, SPRITE_TRAIN, SPRITE_HELICOPTER, SPRITE_AIRPLANE,
  SPRITE_SHIP, SPRITE_MONSTER, SPRITE_TORNADO, SPRITE_EXPLOSION,
  SPRITE_BUS, SPRITE_COUNT
}
enum  MapTileBits {
  PWRBIT = 0x8000, CONDBIT = 0x4000, BURNBIT = 0x2000, BULLBIT = 0x1000,
  ANIMBIT = 0x0800, ZONEBIT = 0x0400, ALLBITS = ZONEBIT | ANIMBIT | BULLBIT | BURNBIT | CONDBIT | PWRBIT, LOMASK = 0x03ff,
  BLBNBIT = BULLBIT | BURNBIT, BLBNCNBIT = BULLBIT | BURNBIT | CONDBIT, BNCNBIT = BURNBIT | CONDBIT
}
enum  ConnectTileCommand {
  CONNECT_TILE_FIX, CONNECT_TILE_BULLDOZE, CONNECT_TILE_ROAD, CONNECT_TILE_RAILROAD,
  CONNECT_TILE_WIRE
}
enum  ToolResult { TOOLRESULT_NO_MONEY = -2, TOOLRESULT_NEED_BULLDOZE = -1, TOOLRESULT_FAILED = 0, TOOLRESULT_OK = 1 }
enum  MapTileCharacters {
  DIRT = 0, RIVER = 2, REDGE = 3, CHANNEL = 4,
  FIRSTRIVEDGE = 5, LASTRIVEDGE = 20, WATER_LOW = RIVER, WATER_HIGH = LASTRIVEDGE,
  TREEBASE = 21, WOODS_LOW = TREEBASE, LASTTREE = 36, WOODS = 37,
  UNUSED_TRASH1 = 38, UNUSED_TRASH2 = 39, WOODS_HIGH = UNUSED_TRASH2, WOODS2 = 40,
  WOODS3 = 41, WOODS4 = 42, WOODS5 = 43, RUBBLE = 44,
  LASTRUBBLE = 47, FLOOD = 48, LASTFLOOD = 51, RADTILE = 52,
  UNUSED_TRASH3 = 53, UNUSED_TRASH4 = 54, UNUSED_TRASH5 = 55, FIRE = 56,
  FIREBASE = FIRE, LASTFIRE = 63, HBRIDGE = 64, ROADBASE = HBRIDGE,
  VBRIDGE = 65, ROADS = 66, ROADS2 = 67, ROADS3 = 68,
  ROADS4 = 69, ROADS5 = 70, ROADS6 = 71, ROADS7 = 72,
  ROADS8 = 73, ROADS9 = 74, ROADS10 = 75, INTERSECTION = 76,
  HROADPOWER = 77, VROADPOWER = 78, BRWH = 79, LTRFBASE = 80,
  BRWV = 95, BRWXXX1 = 111, BRWXXX2 = 127, BRWXXX3 = 143,
  HTRFBASE = 144, BRWXXX4 = 159, BRWXXX5 = 175, BRWXXX6 = 191,
  LASTROAD = 206, BRWXXX7 = 207, HPOWER = 208, VPOWER = 209,
  LHPOWER = 210, LVPOWER = 211, LVPOWER2 = 212, LVPOWER3 = 213,
  LVPOWER4 = 214, LVPOWER5 = 215, LVPOWER6 = 216, LVPOWER7 = 217,
  LVPOWER8 = 218, LVPOWER9 = 219, LVPOWER10 = 220, RAILHPOWERV = 221,
  RAILVPOWERH = 222, POWERBASE = HPOWER, LASTPOWER = RAILVPOWERH, UNUSED_TRASH6 = 223,
  HRAIL = 224, VRAIL = 225, LHRAIL = 226, LVRAIL = 227,
  LVRAIL2 = 228, LVRAIL3 = 229, LVRAIL4 = 230, LVRAIL5 = 231,
  LVRAIL6 = 232, LVRAIL7 = 233, LVRAIL8 = 234, LVRAIL9 = 235,
  LVRAIL10 = 236, HRAILROAD = 237, VRAILROAD = 238, RAILBASE = HRAIL,
  LASTRAIL = 238, ROADVPOWERH = 239, RESBASE = 240, FREEZ = 244,
  HOUSE = 249, LHTHR = HOUSE, HHTHR = 260, RZB = 265,
  HOSPITALBASE = 405, HOSPITAL = 409, CHURCHBASE = 414, CHURCH0BASE = 414,
  CHURCH = 418, CHURCH0 = 418, COMBASE = 423, COMCLR = 427,
  CZB = 436, COMLAST = 609, INDBASE = 612, INDCLR = 616,
  LASTIND = 620, IND1 = 621, IZB = 625, IND2 = 641,
  IND3 = 644, IND4 = 649, IND5 = 650, IND6 = 676,
  IND7 = 677, IND8 = 686, IND9 = 689, PORTBASE = 693,
  PORT = 698, LASTPORT = 708, AIRPORTBASE = 709, RADAR = 711,
  AIRPORT = 716, COALBASE = 745, POWERPLANT = 750, LASTPOWERPLANT = 760,
  FIRESTBASE = 761, FIRESTATION = 765, POLICESTBASE = 770, POLICESTATION = 774,
  STADIUMBASE = 779, STADIUM = 784, FULLSTADIUM = 800, NUCLEARBASE = 811,
  NUCLEAR = 816, LASTZONE = 826, LIGHTNINGBOLT = 827, HBRDG0 = 828,
  HBRDG1 = 829, HBRDG2 = 830, HBRDG3 = 831, HBRDG_END = 832,
  RADAR0 = 832, RADAR1 = 833, RADAR2 = 834, RADAR3 = 835,
  RADAR4 = 836, RADAR5 = 837, RADAR6 = 838, RADAR7 = 839,
  FOUNTAIN = 840, INDBASE2 = 844, TELEBASE = 844, TELELAST = 851,
  SMOKEBASE = 852, TINYEXP = 860, SOMETINYEXP = 864, LASTTINYEXP = 867,
  TINYEXPLAST = 883, COALSMOKE1 = 916, COALSMOKE2 = 920, COALSMOKE3 = 924,
  COALSMOKE4 = 928, FOOTBALLGAME1 = 932, FOOTBALLGAME2 = 940, VBRDG0 = 948,
  VBRDG1 = 949, VBRDG2 = 950, VBRDG3 = 951, NUKESWIRL1 = 952,
  NUKESWIRL2 = 953, NUKESWIRL3 = 954, NUKESWIRL4 = 955, CHURCH1BASE = 956,
  CHURCH1 = 960, CHURCH2BASE = 965, CHURCH2 = 969, CHURCH3BASE = 974,
  CHURCH3 = 978, CHURCH4BASE = 983, CHURCH4 = 987, CHURCH5BASE = 992,
  CHURCH5 = 996, CHURCH6BASE = 1001, CHURCH6 = 1005, CHURCH7BASE = 1010,
  CHURCH7 = 1014, CHURCH7LAST = 1018, TILE_COUNT = 1024, TILE_INVALID = -1
}
enum  EditingTool {
  TOOL_RESIDENTIAL, TOOL_COMMERCIAL, TOOL_INDUSTRIAL, TOOL_FIRESTATION,
  TOOL_POLICESTATION, TOOL_QUERY, TOOL_WIRE, TOOL_BULLDOZER,
  TOOL_RAILROAD, TOOL_ROAD, TOOL_STADIUM, TOOL_PARK,
  TOOL_SEAPORT, TOOL_COALPOWER, TOOL_NUCLEARPOWER, TOOL_AIRPORT,
  TOOL_NETWORK, TOOL_WATER, TOOL_LAND, TOOL_FOREST,
  TOOL_COUNT, TOOL_FIRST = TOOL_RESIDENTIAL, TOOL_LAST = TOOL_FOREST
}
enum  Scenario {
  SC_NONE, SC_DULLSVILLE, SC_SAN_FRANCISCO, SC_HAMBURG,
  SC_BERN, SC_TOKYO, SC_DETROIT, SC_BOSTON,
  SC_RIO, SC_COUNT
}
enum  ZoneType { ZT_COMMERCIAL, ZT_INDUSTRIAL, ZT_RESIDENTIAL, ZT_NUM_DESTINATIONS }
enum  CityVotingProblems {
  CVP_CRIME, CVP_POLLUTION, CVP_HOUSING, CVP_TAXES,
  CVP_TRAFFIC, CVP_UNEMPLOYMENT, CVP_FIRE, CVP_NUMPROBLEMS,
  CVP_PROBLEM_COMPLAINTS = 4, PROBNUM = 10
}
enum  CityClass {
  CC_VILLAGE, CC_TOWN, CC_CITY, CC_CAPITAL,
  CC_METROPOLIS, CC_MEGALOPOLIS, CC_NUM_CITIES
}
enum  GameLevel {
  LEVEL_EASY, LEVEL_MEDIUM, LEVEL_HARD, LEVEL_COUNT,
  LEVEL_FIRST = LEVEL_EASY, LEVEL_LAST = LEVEL_HARD
}

Functions

template<typename T>
static T min (const T a, const T b)
template<typename T>
static T max (const T a, const T b)
template<typename T>
static T clamp (const T val, const T lower, const T upper)
template<typename T>
static T absoluteValue (const T val)
static void not_reached (int line, const char *fname)

Variables

static const int BITS_PER_TILE = 16
static const int BYTES_PER_TILE = 2
static const int WORLD_W_2 = WORLD_W / 2
static const int WORLD_H_2 = WORLD_H / 2
static const int WORLD_W_4 = WORLD_W / 4
static const int WORLD_H_4 = WORLD_H / 4
static const int WORLD_W_8 = WORLD_W / 8
static const int WORLD_H_8 = (WORLD_H + 7) / 8
static const int EDITOR_TILE_SIZE = 16
static const int PASSES_PER_CITYTIME = 16
static const int CITYTIMES_PER_MONTH = 4
static const int CITYTIMES_PER_YEAR = CITYTIMES_PER_MONTH * 12
static const int HISTORY_LENGTH = 480
static const int MISC_HISTORY_LENGTH = 240
static const int HISTORY_COUNT = 120
static const int POWER_STACK_SIZE = (WORLD_W * WORLD_H) / 4
static const int NOWHERE = -1
static const int MAX_TRAFFIC_DISTANCE = 30
static const int MAX_ROAD_EFFECT = 32
static const int MAX_POLICE_STATION_EFFECT = 1000
static const int MAX_FIRE_STATION_EFFECT = 1000
static const int RES_VALVE_RANGE = 2000
static const int COM_VALVE_RANGE = 1500
static const int IND_VALVE_RANGE = 1500


Detailed Description

Micropolis include file

Definition in file micropolis.h.


Define Documentation

#define IS_INTEL   1

Used to determine byte order.

Todo:
Determine byte order a better way.

Definition at line 120 of file micropolis.h.

#define LENGTH_OF ( array   )     (sizeof(array) / sizeof((array)[0]))

Compute length of array

Parameters:
array Array to get length from
Note:
Macro only works for statically allocated arrays

Definition at line 907 of file micropolis.h.

Referenced by Micropolis::collectTax(), Micropolis::doDisasters(), Micropolis::doSpecialZone(), Micropolis::driveDone(), Micropolis::setValves(), and Micropolis::simLoadInit().

#define MICROPOLIS_VERSION   "5.0"

The version number of Micropolis.

Definition at line 125 of file micropolis.h.

Referenced by Micropolis::getMicropolisVersion().

 
#define NOT_REACHED (  )     not_reached(__LINE__, __FILE__)


Typedef Documentation

typedef unsigned short MapTile

Value of a tile in the map array excluding the MapTileBits (that is, just a value from MapCharacters).

Definition at line 347 of file micropolis.h.

typedef unsigned short MapValue

Value of a tile in the map array incuding the MapTileBits.

Definition at line 341 of file micropolis.h.


Enumeration Type Documentation

enum CityClass

Available classes of cities

Enumerator:
CC_VILLAGE  Village.
CC_TOWN  Town, > 2000 citizens.
CC_CITY  City, > 10000 citizens.
CC_CAPITAL  Capital, > 50000 citizens.
CC_METROPOLIS  Metropolis, > 100000 citizens.
CC_MEGALOPOLIS  Megalopolis, > 500000 citizens.
CC_NUM_CITIES  Number of city classes.

Definition at line 810 of file micropolis.h.

Problems in the city where citizens vote on

Todo:
Eliminate PROBNUM
Enumerator:
CVP_CRIME  Crime.
CVP_POLLUTION  Pollution.
CVP_HOUSING  Housing.
CVP_TAXES  Taxes.
CVP_TRAFFIC  Traffic.
CVP_UNEMPLOYMENT  Unemployment.
CVP_FIRE  Fire.
CVP_NUMPROBLEMS  Number of problems.
CVP_PROBLEM_COMPLAINTS  Number of problems to complain about.

Definition at line 793 of file micropolis.h.

Connect tile commands.

Enumerator:
CONNECT_TILE_FIX  Fix zone (connect wire, road, and rail).
CONNECT_TILE_BULLDOZE  Bulldoze and fix zone.
CONNECT_TILE_ROAD  Lay road and fix zone.
CONNECT_TILE_RAILROAD  Lay rail and fix zone.
CONNECT_TILE_WIRE  Lay wire and fix zone.

Definition at line 378 of file micropolis.h.

Available tools.

These describe the wand values, the object dragged around on the screen.

Definition at line 725 of file micropolis.h.

enum GameLevel

Game levels

Enumerator:
LEVEL_EASY  Simple game level.
LEVEL_MEDIUM  Intermediate game level.
LEVEL_HARD  Difficult game level.
LEVEL_COUNT  Number of game levels.
LEVEL_FIRST  First game level value.
LEVEL_LAST  Last game level value.

Definition at line 822 of file micropolis.h.

Available historic scales.

Enumerator:
HISTORY_SCALE_SHORT  Short scale data (10 years).
HISTORY_SCALE_LONG  Long scale data (120 years).
HISTORY_SCALE_COUNT  Number of history scales available.

Definition at line 289 of file micropolis.h.

Available types of historic data.

Enumerator:
HISTORY_TYPE_RES  Residiential history type.
HISTORY_TYPE_COM  Commercial history type.
HISTORY_TYPE_IND  Industry history type.
HISTORY_TYPE_MONEY  Money history type.
HISTORY_TYPE_CRIME  Crime history type.
HISTORY_TYPE_POLLUTION  Pollution history type.
HISTORY_TYPE_COUNT  Number of history types.

Definition at line 275 of file micropolis.h.

Status bits of a map tile.

See also:
MapTile MapCharacters MapTile MapValue
Todo:
ALLBITS should end with MASK.
Todo:
Decide what to do with ANIMBIT (since sim-backend may not be the optimal place to do animation).
Todo:
How many of these bits can be derived from the displayed tile?
Enumerator:
PWRBIT  bit 15, tile has power.
CONDBIT  bit 14. tile can conduct electricity.
BURNBIT  bit 13, tile can be lit.
BULLBIT  bit 12, tile is bulldozable.
ANIMBIT  bit 11, tile is animated.
ZONEBIT  bit 10, tile is the center tile of the zone.
ALLBITS  Mask for the bits-part of the tile.
LOMASK  Mask for the MapTileCharacters part of the tile.

Definition at line 357 of file micropolis.h.

Characters of the map tiles, the lower 10 bits (0--9).

See also:
LOMASK MapTileBitmasks
Todo:
Add TILE_ prefix
Todo:
Make LOW/BASE and LAST/HIGH consistent everywhere?
Todo:
Figure out what sprite groups really exist (maybe we can learn more by examining the actual sprites, and/or by using hexadecimal or bite-wise notation?)
Todo:
Add comments for each sprite (0--1023)
Enumerator:
DIRT  Clear tile.
WATER_LOW  First water tile.
WATER_HIGH  Last water tile (inclusive).
RADTILE  Radio-active contaminated tile.
HBRIDGE  Horizontal bridge.
VBRIDGE  Vertical bridge.
LTRFBASE  First tile with low traffic.
HTRFBASE  First tile with high traffic.
RAILHPOWERV  Horizontal rail, vertical power.
RAILVPOWERH  Vertical rail, horizontal power.
INDBASE  Top-left tile of empty industrial zone.
INDCLR  Center tile of empty industrial zone.
LASTIND  Last tile of empty industrial zone.
IND1  Top-left tile of first non-empty industry zone.
IZB  Center tile of first non-empty industry zone.
PORTBASE  Top-left tile of the seaport.
PORT  Center tile of the seaport.
LASTPORT  Last tile of the seaport.
COALBASE  First tile of coal power plant.
POWERPLANT  'Center' tile of coal power plant.
LASTPOWERPLANT  Last tile of coal power plant.
FIRESTBASE  First tile of fire station.
FIRESTATION  'Center tile' of fire station.
STADIUMBASE  First tile stadium.
STADIUM  'Center tile' stadium.
NUCLEARBASE  First tile nuclear power plant.
NUCLEAR  'Center' tile nuclear power plant.
LASTZONE  Also last tile nuclear power plant.
COALSMOKE1  919 last animation tile for chimney at coal power plant (2, 0).

Chimney animation at coal power plant (2, 0).

COALSMOKE2  923 last animation tile for chimney at coal power plant (3, 0).

Chimney animation at coal power plant (3, 0).

COALSMOKE3  927 last animation tile for chimney at coal power plant (2, 1).

Chimney animation at coal power plant (2, 1).

COALSMOKE4  931 last animation tile for chimney at coal power plant (3, 1).

Chimney animation at coal power plant (3, 1).

TILE_INVALID  Invalid tile (not used in the world map).

Definition at line 409 of file micropolis.h.

enum MapType

Available map types.

Enumerator:
MAP_TYPE_ALL  All zones.
MAP_TYPE_RES  Residential zones.
MAP_TYPE_COM  Commercial zones.
MAP_TYPE_IND  Industrial zones.
MAP_TYPE_POWER  Power connectivity.
MAP_TYPE_ROAD  Roads.
MAP_TYPE_POPULATION_DENSITY  Population density.
MAP_TYPE_RATE_OF_GROWTH  Rate of growth.
MAP_TYPE_TRAFFIC_DENSITY  Traffic.
MAP_TYPE_POLLUTION  Pollution.
MAP_TYPE_CRIME  Crime rate.
MAP_TYPE_LAND_VALUE  Land value.
MAP_TYPE_FIRE_RADIUS  Fire station coverage radius.
MAP_TYPE_POLICE_RADIUS  Police station coverage radius.
MAP_TYPE_DYNAMIC  Dynamic filter.
MAP_TYPE_COUNT  Number of map types.

Definition at line 299 of file micropolis.h.

enum Scenario

Available scenarios

Enumerator:
SC_NONE  No scenario (free playing).
SC_DULLSVILLE  Dullsville (boredom).
SC_SAN_FRANCISCO  San francisco (earthquake).
SC_HAMBURG  Hamburg (fire bombs).
SC_BERN  Bern (traffic).
SC_TOKYO  Tokyo (scary monster).
SC_DETROIT  Detroit (crime).
SC_BOSTON  Boston (nuclear meltdown).
SC_RIO  Rio (flooding).
SC_COUNT  Number of scenarios.

Definition at line 757 of file micropolis.h.

enum SpriteType

Enumerator:
SPRITE_TRAIN  Train sprite.
SPRITE_HELICOPTER  Helicopter sprite.
SPRITE_AIRPLANE  Airplane sprite.
SPRITE_SHIP  Ship.
SPRITE_MONSTER  Scary monster.
SPRITE_TORNADO  Tornado sprite.
SPRITE_EXPLOSION  Explosion sprite.
SPRITE_BUS  Bus sprite.
SPRITE_COUNT  Number of sprite objects.

Definition at line 321 of file micropolis.h.

enum ToolResult

Tool result.

Todo:
Make the rest of the code use this instead of magic numbers.
Enumerator:
TOOLRESULT_NO_MONEY  User has not enough money for tool.
TOOLRESULT_NEED_BULLDOZE  Clear the area first.
TOOLRESULT_FAILED  Cannot build here.
TOOLRESULT_OK  Build succeeded.

Definition at line 391 of file micropolis.h.

enum ZoneType

Available zone types

Enumerator:
ZT_COMMERCIAL  Commercial zone.
ZT_INDUSTRIAL  Industrial zone.
ZT_RESIDENTIAL  Residential zone.
ZT_NUM_DESTINATIONS  Number of available zones.

Definition at line 777 of file micropolis.h.


Function Documentation

template<typename T>
static T absoluteValue ( const T  val  )  [inline, static]

Compute absolute value.

Parameters:
val Input value.
Returns:
Absolute value of val.

Definition at line 890 of file micropolis.h.

Referenced by Micropolis::getBoatDistance(), Micropolis::getDir(), Micropolis::getDistance(), and Micropolis::toolDrag().

template<typename T>
static T clamp ( const T  val,
const T  lower,
const T  upper 
) [inline, static]

Clamp value between lower and upper bound.

Parameters:
val Value.
lower Lower bound (inclusive).
upper Upper bound (inclusive).
Returns:
val, limited to the range given by the lower and upper bound.

Definition at line 873 of file micropolis.h.

Referenced by Micropolis::crimeScan(), Micropolis::decRateOfGrowthMap(), Micropolis::doBusSprite(), Micropolis::doZoneStatus(), Micropolis::drawMonth(), Micropolis::fireZone(), Micropolis::getScore(), Micropolis::incRateOfGrowth(), Micropolis::setValves(), Micropolis::startFireInZone(), and Micropolis::take10Census().

template<typename T>
static T max ( const T  a,
const T  b 
) [inline, static]

Compute maximal value.

Parameters:
a First value.
b Second value.
Returns:
Maximum of a and b.

Definition at line 858 of file micropolis.h.

Referenced by Micropolis::getHistoryRange(), Micropolis::initGraphMax(), Micropolis::loadFile(), Micropolis::setValves(), and Micropolis::take10Census().

template<typename T>
static T min ( const T  a,
const T  b 
) [inline, static]

static void not_reached ( int  line,
const char *  fname 
) [inline, static]

Give a fatal error and exit the program.

Parameters:
line Source line number of the fatal error.
fname Filename of the source file.
Returns:
Does not return to the caller.
Todo:
Generalize error handling/exiting of the simulator.

Definition at line 922 of file micropolis.h.


Variable Documentation

const int BITS_PER_TILE = 16 [static]

The number of bits per tile.

Todo:
Only used in python/micropolisdrawingarea.py

Definition at line 136 of file micropolis.h.

const int BYTES_PER_TILE = 2 [static]

The number of bytes per tile.

Todo:
Only used in python/micropolisdrawingarea.py

Definition at line 142 of file micropolis.h.

const int CITYTIMES_PER_MONTH = 4 [static]

The number of cityTime units per month.

Definition at line 199 of file micropolis.h.

const int CITYTIMES_PER_YEAR = CITYTIMES_PER_MONTH * 12 [static]

The number of cityTime units per year.

Definition at line 204 of file micropolis.h.

const int EDITOR_TILE_SIZE = 16 [static]

The size of the editor view tiles, in pixels.

Definition at line 189 of file micropolis.h.

const int HISTORY_COUNT = 120 [static]

Length of the history tables.

Todo:
It is not really a count of histories, rename to something else?

Definition at line 220 of file micropolis.h.

Referenced by Micropolis::getHistory(), Micropolis::getHistoryRange(), and Micropolis::setHistory().

const int HISTORY_LENGTH = 480 [static]

The number of history entries.

Definition at line 209 of file micropolis.h.

Referenced by Micropolis::initMapArrays(), Micropolis::loadFileDir(), and Micropolis::saveFile().

const int MAX_FIRE_STATION_EFFECT = 1000 [static]

const int MAX_POLICE_STATION_EFFECT = 1000 [static]

const int MAX_ROAD_EFFECT = 32 [static]

const int MAX_TRAFFIC_DISTANCE = 30 [static]

Maximal number of map tiles to drive, looking for a destination

Definition at line 241 of file micropolis.h.

Referenced by Micropolis::init(), Micropolis::pushPos(), and Micropolis::tryDrive().

const int MISC_HISTORY_LENGTH = 240 [static]

The number of miscellaneous history entries.

Definition at line 214 of file micropolis.h.

Referenced by Micropolis::initMapArrays(), Micropolis::loadFileDir(), and Micropolis::saveFile().

const int NOWHERE = -1 [static]

A constant used in place of an x or y position to indicate "nowhere".

Definition at line 232 of file micropolis.h.

Referenced by Micropolis::checkGrowth(), Micropolis::doBudgetNow(), Micropolis::doScenarioScore(), Micropolis::toolDown(), and Micropolis::updateDate().

const int PASSES_PER_CITYTIME = 16 [static]

The number of simulator passes per cityTime unit.

Definition at line 194 of file micropolis.h.

const int POWER_STACK_SIZE = (WORLD_W * WORLD_H) / 4 [static]

The size of the power stack.

Definition at line 225 of file micropolis.h.

Referenced by Micropolis::init(), and Micropolis::pushPowerStack().

const int WORLD_H_2 = WORLD_H / 2 [static]

Vertical size of the world for a map that stores a value for every 2x2 square.

Definition at line 156 of file micropolis.h.

Referenced by Micropolis::doBusSprite().

const int WORLD_H_4 = WORLD_H / 4 [static]

Vertical size of the world for a map that stores a value for every 4x4 square.

Definition at line 170 of file micropolis.h.

const int WORLD_H_8 = (WORLD_H + 7) / 8 [static]

Vertical size of the world for a map that stores a value for every 8x8 square.

Definition at line 184 of file micropolis.h.

const int WORLD_W_2 = WORLD_W / 2 [static]

Horizontal size of the world for a map that stores a value for every 2x2 square.

Todo:
Make a Map class that keeps its 2x2 square storage details internally, so the code doesn't need to bother with it.

Definition at line 150 of file micropolis.h.

const int WORLD_W_4 = WORLD_W / 4 [static]

Horizontal size of the world for a map that stores a value for every 4x4 square.

Todo:
Make a Map class that keeps its 4x4 square storage details internally, so the code doesn't need to bother with it.

Definition at line 164 of file micropolis.h.

const int WORLD_W_8 = WORLD_W / 8 [static]

Horizontal size of the world for a map that stores a value for every 8x8 square.

Todo:
Make a Map class that keeps its 8x8 square storage details internally, so the code doesn't need to bother with it.

Definition at line 178 of file micropolis.h.


Generated on Wed Feb 2 09:19:22 2011 for Micropolis by  doxygen 1.5.6