Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

source/simulation.c File Reference

the simulation routines More...

#include <handler.h>
#include <drawing.h>
#include <zakdef.h>
#include <logging.h>
#include <locking.h>
#include <ui.h>
#include <globals.h>
#include <disaster.h>
#include <simulation.h>
#include <stack.h>
#include <compilerpragmas.h>
#include <mem_compat.h>

Go to the source code of this file.

Data Structures

struct  _distrib
 Structure for performing distribution. More...

struct  countCosts
 mapping of item counts and their associated costs More...

struct  ZoneScore
 Zone scores. More...


Defines

#define SHORT_BIT   1
 short and out bits


Typedefs

typedef _distrib distrib_t
 Structure for performing distribution.


Functions

void DoTaxes (void)
 Add money because of taxes.

void DoUpkeep (void)
 Take away money because of upkeep costs.

Int16 DistributeNumberOfSquaresAround (distrib_t *distrib, UInt32 pos)
 gives a status of the situation around us

void reGradeZones (void)
 Regrade the zones.

void DowngradeZone (UInt32 pos)
 Downgrade the zone at the position specified.

Int16 DoTheRoadTrip (UInt32 startPos)
 Walk the road, looking for things at the end.

UInt32 DistributeMoveOn (UInt32 pos, dirType direction)
 Distribute supply to locations around this node.

void DistributeUnvisited (distrib_t *distrib)
 Distribute power to the unvisited list.

long GetZoneScore (UInt32 pos)
 Get the score for this zone.

Int16 GetScoreFor (zoneType iamthis, welem_t what)
 Get the score for the zone specified.

Int32 GetRandomZone (void)
 Get a zone on the world.

void FindZonesForUpgrading (void)
 Find a bunch of zones and decide to upgrade/downgrade them.

Int16 FindScoreForZones (void)
 find the scores that apply to the scoring zones

void AddNeighbors (distrib_t *distrib, UInt32 pos)
 Add all the neighbors to this node to the unvisited list.

UInt8 ExistsNextto (UInt32 pos, UInt8 dirs, welem_t what)
 check if a node exists next to other types of nodes

void DoDistribute (Int16 grid)
 Do Distribution of the grid (water/power).

void Sim_Distribute_Specific (Int16 gridonly)
 Do a grid distribution for the grid(s) specified.

Int16 IsItAPowerPlant (welem_t point, UInt32 coord, selem_t flags)
 Check if the node is a power plant (Nuclear/Coal).

Int16 IsItAWaterPump (welem_t point, UInt32 coord, selem_t flags)
 Check if the node is a Water Pump.

void SetSupplied (distrib_t *distrib, UInt32 point)
 Set the supplied bit for the point specified.

Int16 SupplyIfPlant (distrib_t *distrib, UInt32 pos, welem_t point, selem_t status)
 Add source to the grid.

Int16 zoneCmpFn (void *a, void *b, Int32 other)
 compare two zones for the quicksort

Int32 costIt (BuildCode item)
 get the costs of a specific node

Int32 BudgetGetNumber (BudgetNumber type)
 Get a number for the budget.

Int16 Sim_DoPhase (Int16 nPhase)
 Perform a phase of the simulation.

void UpdateVolatiles (void)
 update the vgame entries

UInt16 ShuffleIndividualStatistic (UInt16 *ary, UInt16 load)
 shuffle an individual set of statistics

void UpdateCounters (void)
 Update the various counter entities for the statistics.

void RecordStatistics (void)
 record all the statistics for the month.

UInt32 getPopulation (void)
 get the population of the simulation

Int16 CarryPower (welem_t x)
 Can the node carry power.

Int16 CarryWater (welem_t x)
 can the node carry water.

Int16 IsPowerLine (welem_t x)
 Is this node a power line.

Int16 IsRoad (welem_t x)
 Is this node a road.

Int16 IsRoadBridge (welem_t x)
 is this node a bridge

Int16 IsWaterPipe (welem_t x)
 is this node a water pipe

Int16 ZoneValue (welem_t x)
 get the value of the zone

Int16 IsRoadPipe (welem_t x)
 is the node a road overlapping with power

Int16 IsRoadPower (welem_t x)
 is the node a road overlapping with power

Int16 IsPowerWater (welem_t x)
 is the node a power overlapping with water pipe

Int16 IsZone (welem_t x, zoneType nType)
 Is this node of the zone type passed in.

Int16 IsTransport (welem_t x)
 Is this node a transportation node?

Int16 IsRoadOrBridge (welem_t x)
 is the zone either a road or bridge

Int16 IsRail (welem_t x)
 is the node Rail

Int16 IsRailPower (welem_t x)
 is the node rail overlapping power

Int16 IsRailPipe (welem_t x)
 is the node rail overlapping with a pipe

Int16 IsRailTunnel (welem_t x)
 is the node a rail tunnel

Int16 IsRailOrTunnel (welem_t x)
 is the node a rail line or a tunnel

Int16 IsRailOvRoad (welem_t x)
 is the node a rail track overlapping with a road

Int16 IsOccupied (welem_t x)
 is this zone occupied

UInt8 CheckNextTo1 (UInt32 pos, UInt8 dirs, carryfnarg_t checkfn, void *cfarg)
 check if one of the zones around it is of a certain type.


Variables

ZoneScoreran_zone
 random zone list

Int32 at_pos
 Current position in list (either random or linear).

UInt16 counter
 counter to ensure we don't spend too much time looping

UInt16 max_list
 maximum size of the random list

const struct countCosts countCosts []
 mapping of item counts and their associated costs


Detailed Description

the simulation routines

This consists of the outines that do all the simulation work, for example deciding that certain zones are to be improved or deteriorated, where monsters go to; etc,

Definition in file simulation.c.


Function Documentation

void AddNeighbors distrib_t   distrib,
UInt32    pos
[static]
 

Add all the neighbors to this node to the unvisited list.

Parameters:
distrib  the distribution structure
pos  location of node on list

Definition at line 330 of file simulation.c.

References DistributeNumberOfSquaresAround(), getMapWidth, Int16, Int32, _distrib::NodesTotal, StackPush(), UInt32, and _distrib::unvisitedNodes.

Referenced by DistributeUnvisited(), and DoDistribute().

Int32 BudgetGetNumber BudgetNumber    type
 

Get a number for the budget.

Parameters:
type  the item that we want to extract
Returns:
the value of that item from the budget

Definition at line 983 of file simulation.c.

References bc_coalplants, bc_count_roads, bc_fire_stations, bc_military_bases, bc_nuclearplants, bc_police_departments, bc_powerlines, bc_value_commercial, bc_value_industrial, bc_value_residential, BudgetNumber, costIt(), Int32, ue_defense, ue_power, and ue_traffic.

Referenced by budget_defence(), budget_power(), budget_traffic(), budgetSetup(), DoTaxes(), DoUpkeep(), UIUpdateBudget(), and updateBudgetNumber().

Int16 CarryPower welem_t    x
 

Can the node carry power.

This works this way because all the nodes that carry water are in sequence

Definition at line 1318 of file simulation.c.

References IsPump, IsRailPower(), and welem_t.

Referenced by DoDistribute(), DrawFieldWithoutInit(), hoverUpdate(), and querySetup().

Int16 CarryWater welem_t    x
 

can the node carry water.

This is slightly more complicated because the nodes that carry water are not in the same order as the nodes that carry power.

This is the tradeoff that has to be made. One is faster at the expense of the other.

Definition at line 1339 of file simulation.c.

References IsPump, IsRailPipe(), IsRoadPipe(), IsWaterPipe(), and welem_t.

Referenced by DoDistribute(), DrawFieldWithoutInit(), hoverUpdate(), and querySetup().

UInt8 CheckNextTo1 UInt32    pos,
UInt8    dirs,
carryfnarg_t    checkfn,
void *    cfarg
 

check if one of the zones around it is of a certain type.

Parameters:
pos  starting position
dirs  the directions to check
checkfn  function to check with
cfarg  argument for the check function
Returns:
the directions that match using the check function.

Definition at line 1495 of file simulation.c.

References getMapWidth, getWorld(), MapMul, UInt32, and UInt8.

Int32 costIt BuildCode    item [static]
 

get the costs of a specific node

Parameters:
item  the item who's cost we wish to extract
Returns:
the cost/benefit associated with the node

Definition at line 972 of file simulation.c.

References UInt16.

Referenced by BudgetGetNumber().

UInt32 DistributeMoveOn UInt32    pos,
dirType    direction
[static]
 

Distribute supply to locations around this node.

this function take a position and a direction and moves the position in the direction, but won't move behind map borders

Parameters:
pos  location in map to source from
direction  direction move to
Returns:
the location to move to, or the same position

Definition at line 427 of file simulation.c.

References dirType, dtDown, dtLeft, dtRight, dtUp, getMapWidth, MapMul, and UInt32.

Referenced by DistributeNumberOfSquaresAround().

Int16 DistributeNumberOfSquaresAround distrib_t   distrib,
UInt32    pos
[static]
 

gives a status of the situation around us

Checks all the nodes around this position to see if they should be visited to supply them with the appropriate supply item. 0001 00xx if up 0010 00xx if right 0100 00xx if down 1000 00xx if left xx = number of directions

Parameters:
distrib  the distribution glob to use for searching
pos  map location to perfrm distribution on.
Returns:
fields & quantity in an overloaded array

Definition at line 388 of file simulation.c.

References DistributeMoveOn(), _distrib::doescarry, dtDown, dtLeft, dtRight, dtUp, Int16, Int8, and UInt32.

Referenced by AddNeighbors().

void DoDistribute Int16    grid [static]
 

Do Distribution of the grid (water/power).

Parameters:
grid  grid to perform distribution on

Definition at line 209 of file simulation.c.

References AddNeighbors(), andWorldFlags(), CarryPower(), CarryWater(), DistributeUnvisited(), _distrib::doescarry, _distrib::error_flag, _distrib::flagToSet, getWorld(), getWorldFlags(), GRID_POWER, Int16, IsItAPowerPlant(), IsItAWaterPump(), _distrib::isplant, LockZone(), lz_flags, lz_world, MapMul, _distrib::needSourceList, _distrib::NodesSupplied, _distrib::NodesTotal, PAINTEDBIT, peFineOnPower, peFineOnWater, POWEREDBIT, SCRATCHBIT, selem_t, SHORT_BIT, _distrib::ShortOrOut, _distrib::SourceLeft, _distrib::SourceTotal, StackDelete(), StackDoEmpty(), StackNew(), SupplyIfPlant(), UInt32, UIProblemNotify(), UnlockZone(), _distrib::unvisitedNodes, WATEREDBIT, and welem_t.

Referenced by Sim_Distribute_Specific().

Int16 DoTheRoadTrip UInt32    startPos [static]
 

Walk the road, looking for things at the end.

Todo:
actually do the road trip

Definition at line 732 of file simulation.c.

References UInt32.

Referenced by GetZoneScore().

void DowngradeZone UInt32    pos [static]
 

Downgrade the zone at the position specified.

Parameters:
pos  the location on the map to downgrade.

Definition at line 643 of file simulation.c.

References bc_count_commercial, bc_count_industrial, bc_count_residential, bc_value_commercial, bc_value_industrial, bc_value_residential, DrawFieldWithoutInit(), getMapWidth, getWorld(), IsCommercial, IsIndustrial, IsResidential, LockZone(), lz_flags, lz_world, setWorld(), UInt16, UInt32, UnlockZone(), and welem_t.

Referenced by FindScoreForZones(), and reGradeZones().

UInt8 ExistsNextto UInt32    pos,
UInt8    dirs,
welem_t    what
[static]
 

check if a node exists next to other types of nodes

Parameters:
pos  index into map
dirs  directions to check
what  the node type to compare it against
Returns:
true if the node is next to it.

Definition at line 462 of file simulation.c.

References getMapWidth, getWorld(), MapMul, UInt32, UInt8, and welem_t.

Referenced by IsItAWaterPump().

Int16 FindScoreForZones void    [static]
 

find the scores that apply to the scoring zones

The score finding routine is divided into small bits of 10 zones per run. This is to free the program flow to take care of user interaction. All functions in the simulation part should complete in under 3/4 second, or the user might see the program as being slow.

Returns:
true of more zones need to be processed.

Definition at line 543 of file simulation.c.

References at_pos, counter, DowngradeZone(), getMapWidth, GetZoneScore(), Int32, LockZone(), lz_flags, lz_world, ZoneScore::pos, ZoneScore::score, UInt32, and UnlockZone().

Referenced by Sim_DoPhase().

void FindZonesForUpgrading void    [static]
 

Find a bunch of zones and decide to upgrade/downgrade them.

We use a list containing a number of random zones numbering three times the width or height of the map whichever is biggest.

Definition at line 509 of file simulation.c.

References at_pos, getMapHeight, getMapWidth, GetRandomZone(), Int32, max_list, and UInt16.

Referenced by Sim_DoPhase().

UInt32 getPopulation void   
 

get the population of the simulation

Returns:
the population

Definition at line 1307 of file simulation.c.

References bc_value_commercial, bc_value_industrial, and bc_value_residential.

Referenced by UIDrawPop(), and UIPaintPopulation().

Int32 GetRandomZone void    [static]
 

Get a zone on the world.

Must be one of the Residential / Industrial /commercial zones

Returns:
the zone picked, or -1 for no zone found

Definition at line 919 of file simulation.c.

References GetRandomNumber(), getWorld(), IsGrowable, LockZone(), lz_flags, lz_world, MapMul, UInt16, UInt32, UInt8, and UnlockZone().

Referenced by FindZonesForUpgrading().

Int16 GetScoreFor zoneType    iamthis,
welem_t    what
[static]
 

Get the score for the zone specified.

Parameters:
iamthis  current zone
what  adjacent zone
Returns:
the score for an indvidual zone

Definition at line 857 of file simulation.c.

References IsCoalPlant, IsFakeTree, IsFakeWater, IsNukePlant, IsRealWater, IsRoad(), IsZone(), welem_t, zoneType, ztCommercial, ztIndustrial, and ztResidential.

Referenced by GetZoneScore().

long GetZoneScore UInt32    pos [static]
 

Get the score for this zone.

Parameters:
pos  location on map to get the score of
Returns:
-1 if the zone needs to be downgraded because of a lack of water/power.

Definition at line 745 of file simulation.c.

References bc_value_commercial, bc_value_industrial, bc_value_residential, DoTheRoadTrip(), getMapHeight, getMapWidth, getMonthsElapsed, GetScoreFor(), getWorld(), getWorldFlags(), Int16, Int32, IsRoad(), IsSlum, IsZone(), LockZone(), lz_flags, lz_world, POWEREDBIT, UInt32, UInt8, UnlockZone(), WATEREDBIT, WORLDPOS, zoneType, ztCommercial, ztIndustrial, ztResidential, and ztWhat.

Referenced by FindScoreForZones().

Int16 IsItAPowerPlant welem_t    point,
UInt32    coord,
selem_t    flags
[static]
 

Check if the node is a power plant (Nuclear/Coal).

Parameters:
point  the value at the point
coord  unused
flags  unused
Returns:
wheter it is one or not.

Definition at line 126 of file simulation.c.

References selem_t, UInt32, and welem_t.

Referenced by DoDistribute().

Int16 IsItAWaterPump welem_t    point,
UInt32    coord,
selem_t    flags
[static]
 

Check if the node is a Water Pump.

It is a usable water pump if it has power.

Parameters:
point  node to test
coord  coordiate of the point
flags  flag byte of point.
Returns:
if it is a good water pump.

Definition at line 150 of file simulation.c.

References ExistsNextto(), POWEREDBIT, selem_t, UInt32, and welem_t.

Referenced by DoDistribute().

Int16 IsOccupied welem_t    x
 

is this zone occupied

Parameters:
x  the zone to test

Definition at line 1469 of file simulation.c.

References welem_t.

Int16 IsPowerLine welem_t    x
 

Is this node a power line.

Parameters:
x  the node entry to query
Returns:
true if it's a power line

Definition at line 1347 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), Build_Rail(), Build_Road(), Build_WaterPipe(), DoCommitmentNasties(), GetGraphicNumber(), and UpdateVolatiles().

Int16 IsPowerWater welem_t    x
 

is the node a power overlapping with water pipe

Parameters:
x  the node to query
Returns:
true if the node is a water pipe overlapping with power

Definition at line 1399 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), DoCommitmentNasties(), and UpdateVolatiles().

Int16 IsRail welem_t    x
 

is the node Rail

Parameters:
x  the zone to test
Returns:
true if the zone is rail

Definition at line 1433 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), Build_PowerLine(), Build_Road(), Build_WaterPipe(), GetGraphicNumber(), IsRailOrTunnel(), IsTransport(), and ZoneValue().

Int16 IsRailOrTunnel welem_t    x
 

is the node a rail line or a tunnel

Parameters:
x  the node to test
Returns:
true if the node is a rail line or a tunnel

Definition at line 1457 of file simulation.c.

References IsRail(), IsRailTunnel(), and welem_t.

Int16 IsRailOvRoad welem_t    x
 

is the node a rail track overlapping with a road

Parameters:
x  the node to test
Returns:
true if the case is true

Definition at line 1463 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), and IsTransport().

Int16 IsRailPipe welem_t    x
 

is the node rail overlapping with a pipe

Parameters:
x  the node to test
Returns:
true if the zone is a rail line overlapping with a pipe

Definition at line 1445 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), CarryWater(), and IsTransport().

Int16 IsRailPower welem_t    x
 

is the node rail overlapping power

Parameters:
x  the zone to test
Returns:
true of the zone is a rail overlapping with power

Definition at line 1439 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), CarryPower(), and IsTransport().

Int16 IsRailTunnel welem_t    x
 

is the node a rail tunnel

Parameters:
x  the node to test
Returns:
true if the zone is a rail tunnel

Definition at line 1451 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), IsRailOrTunnel(), and IsTransport().

Int16 IsRoad welem_t    x
 

Is this node a road.

Parameters:
x  the node entry to query
Returns:
true if it's road

Definition at line 1353 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), Build_Generic(), Build_PowerLine(), Build_Rail(), Build_WaterPipe(), GetGraphicNumber(), GetScoreFor(), GetZoneScore(), IsRoadOrBridge(), IsTransport(), UpdateVolatiles(), and ZoneValue().

Int16 IsRoadBridge welem_t    x
 

is this node a bridge

Parameters:
x  the node to query
Returns:
true if we're a bridge (this is not the same as a road)

Definition at line 1359 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), CreateWaste(), IsRoadOrBridge(), and IsTransport().

Int16 IsRoadOrBridge welem_t    x
 

is the zone either a road or bridge

Parameters:
x  the zone to test
Returns:
true if the zone is either a bridge or road

Definition at line 1427 of file simulation.c.

References IsRoad(), IsRoadBridge(), and welem_t.

Int16 IsRoadPipe welem_t    x
 

is the node a road overlapping with power

Parameters:
x  the node to query
Returns:
true if the node is a road overlapping power line

Definition at line 1387 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), CarryWater(), IsTransport(), and UpdateVolatiles().

Int16 IsRoadPower welem_t    x
 

is the node a road overlapping with power

Parameters:
x  the node to query
Returns:
true if the node is a water overlapping with power

Definition at line 1393 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), IsTransport(), and UpdateVolatiles().

Int16 IsTransport welem_t    x
 

Is this node a transportation node?

Parameters:
x  the noe to check
Returns:
if this is the case
say if the node is road & rail or any overlapping combination thereof

Definition at line 1418 of file simulation.c.

References IsRail(), IsRailOvRoad(), IsRailPipe(), IsRailPower(), IsRailTunnel(), IsRoad(), IsRoadBridge(), IsRoadPipe(), IsRoadPower(), and welem_t.

Referenced by DoCommitmentNasties().

Int16 IsWaterPipe welem_t    x
 

is this node a water pipe

Parameters:
x  the node to query
Returns:
true if this is a pipe

Definition at line 1365 of file simulation.c.

References welem_t.

Referenced by Build_Destroy(), Build_PowerLine(), Build_Rail(), Build_Road(), CarryWater(), DoCommitmentNasties(), GetGraphicNumber(), and UpdateVolatiles().

Int16 IsZone welem_t    x,
zoneType    nType
 

Is this node of the zone type passed in.

Parameters:
x  node item to query
nType  type of node.
Returns:
zone value, or zero.

Definition at line 1405 of file simulation.c.

References welem_t, and zoneType.

Referenced by GetScoreFor(), and GetZoneScore().

void RecordStatistics void   
 

record all the statistics for the month.

This involves compositing the month delta into the graph. This is done by taking the old average; multiplying it by 3, adding the current month's value and dividing by 4. We have to be careful of overflow.

Definition at line 1274 of file simulation.c.

References BuildCount, getMonthsElapsed, _history::last_ten, ShuffleIndividualStatistic(), st_cashflow, st_tail, StatisticItem, UInt16, and UInt32.

void reGradeZones void    [static]
 

Regrade the zones.

sort the zones by score. Upgrade the 12 highest scoring zones, downgrade the 10 lowest scoring zones.

Definition at line 602 of file simulation.c.

References at_pos, DowngradeZone(), getMapWidth, Int16, Int32, ZoneScore::pos, ZoneScore::score, UInt32, and zoneCmpFn().

Referenced by Sim_DoPhase().

void SetSupplied distrib_t   distrib,
UInt32    point
[static]
 

Set the supplied bit for the point specified.

Parameters:
distrib  distribution glob to use
point  location in array of point

Definition at line 164 of file simulation.c.

References _distrib::flagToSet, getWorldFlags(), _distrib::NodesSupplied, orWorldFlags(), and UInt32.

Referenced by DistributeUnvisited(), and SupplyIfPlant().

UInt16 ShuffleIndividualStatistic UInt16   ary,
UInt16    load
[static]
 

shuffle an individual set of statistics

This moves an entire set of statistics 'down' one unit; which corresponds to 3 months (12/4) for the 10 year graph and to 2yr 6 months (10y/4) for the 100 year graph

Parameters:
ary  the array of entries to shuffle
load  the value to load on to the start of the stats.
Returns:
the value that shuffled off the end

Definition at line 1221 of file simulation.c.

References STAT_ENTRIES, and UInt16.

Referenced by RecordStatistics().

void Sim_Distribute_Specific Int16    gridonly [static]
 

Do a grid distribution for the grid(s) specified.

Parameters:
gridonly  the grid to do

Definition at line 102 of file simulation.c.

References addGraphicUpdate(), ClearUpdate, DoDistribute(), GRID_ALL, GRID_POWER, GRID_WATER, gu_desires, gu_playarea, and Int16.

Referenced by Sim_DoPhase().

Int16 Sim_DoPhase Int16    nPhase
 

Perform a phase of the simulation.

Todo:
break into separate functions and a jump table.

Definition at line 1077 of file simulation.c.

References addGraphicUpdate(), ClearUpdate, DoRandomDisaster(), DoTaxes(), DoUpkeep(), FindScoreForZones(), FindZonesForUpgrading(), GRID_POWER, GRID_WATER, gu_credits, gu_desires, gu_population, Int16, NeedsUpdate, reGradeZones(), Sim_Distribute_Specific(), and UICheckMoney().

Referenced by mainloop_callback().

Int16 SupplyIfPlant distrib_t   distrib,
UInt32    pos,
welem_t    point,
selem_t    status
[static]
 

Add source to the grid.

Parameters:
distrib  the distribution structure
pos  index into array of node
point  node value
status  status of node (powered/watered)
Returns:
whether node was supplied

Definition at line 181 of file simulation.c.

References Int16, _distrib::isplant, _distrib::needSourceList, _distrib::NodesTotal, selem_t, SetSupplied(), _distrib::SourceLeft, _distrib::SourceTotal, StackIsEmpty(), StackPop(), UInt32, and welem_t.

Referenced by DistributeUnvisited(), and DoDistribute().

void UpdateCounters void   
 

Update the various counter entities for the statistics.

This updates the various fields that are not recorded directly in the system

Definition at line 1235 of file simulation.c.

References bc_cashflow, and OFFSET_FOR_CASHFLOW_BC.

void UpdateVolatiles void   
 

update the vgame entries

Updates the BuildCount array after a load game.

Definition at line 1137 of file simulation.c.

References bc_coalplants, bc_count_commercial, bc_count_industrial, bc_count_residential, bc_count_roads, bc_count_trees, bc_fire, bc_fire_stations, bc_military_bases, bc_nuclearplants, bc_police_departments, bc_powerlines, bc_value_commercial, bc_value_industrial, bc_value_residential, bc_value_roads, bc_waste, bc_water, bc_waterpipes, bc_waterpumps, getWorld(), IsCommercial, IsFakeTree, IsFakeWater, IsIndustrial, IsPowerLine(), IsPowerWater(), IsPump, IsResidential, IsRoad(), IsRoadPipe(), IsRoadPower(), IsWaterPipe(), LockZone(), lz_flags, lz_world, MapMul, UInt32, UInt8, UnlockZone(), and ZoneValue().

Referenced by PostLoadGame().

Int16 zoneCmpFn void *    a,
void *    b,
Int32    other
[static]
 

compare two zones for the quicksort

Parameters:
a  pointer to first element
b  pointer to second element
other  other value

Definition at line 583 of file simulation.c.

References Int32, and ZoneScore::score.

Referenced by reGradeZones().

Int16 ZoneValue welem_t    x
 

get the value of the zone

Parameters:
x  the node to get the value of
Returns:
the value of the node

Definition at line 1371 of file simulation.c.

References IsRail(), IsRoad(), and welem_t.

Referenced by Build_Destroy(), querySetup(), and UpdateVolatiles().


Generated on Mon Aug 30 19:44:18 2004 for pocketcity by doxygen1.2.18