Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

source/build.h File Reference

The routines for building. More...

#include <zakdef.h>
#include <sections.h>
#include <compilerpragmas.h>

Go to the source code of this file.

Defines

#define BUILD_COST_BULLDOZER   5
 The Cost of building a bulldozer.

#define BUILD_COST_ZONE   50
 The cost of building one of the standard zones.

#define BUILD_COST_ROAD   20
 The cost of building a road.

#define BUILD_COST_POWER_PLANT   3000
 The cost of building a coal power plant.

#define BUILD_COST_NUCLEAR_PLANT   10000
 The cost of building a nuclear power plant.

#define BUILD_COST_POWER_LINE   5
 The cost of building a power line.

#define BUILD_COST_TREE   10
 The cost of building a tree/forest.

#define BUILD_COST_WATER   200
 The cost of building a lake/water.

#define BUILD_COST_BRIDGE   100
 The cost of building a bridge (over water).

#define BUILD_COST_RAIL   25
 Cost of building a rail line.

#define BUILD_COST_RAILTUNNEL   125
 cost of building a rail tunnel

#define BUILD_COST_FIRE_STATION   700
 The cost of building a fire station.

#define BUILD_COST_POLICE_STATION   500
 The cost of building a police station.

#define BUILD_COST_MILITARY_BASE   10000
 The cost of building a military base.

#define BUILD_COST_WATER_PIPE   20
 The cost of building a water pipe.

#define BUILD_COST_WATER_PUMP   3000
 The cost of building a water pump.


Typedefs

typedef enum BuildCode BuildCode
 The codes that are mapped for building items.


Enumerations

enum  BuildCode
 The codes that are mapped for building items. More...


Functions

EXPORT int Build_Bulldoze (UInt16 xpos, UInt16 ypos, welem_t _unused)\BUILD_SECTION
 Bulldoze a zone.

EXPORT int BuildSomething (UInt16 xpos, UInt16 ypos) BUILD_SECTION
 Build something at the location specified.

EXPORT void Build_Destroy (UInt16 xpos, UInt16 ypos) BUILD_SECTION
 Attempt to destroy the item at the position in question.

EXPORT void CreateFullRiver (void) BUILD_SECTION
 Create a river on the map.

EXPORT void CreateForests (void) BUILD_SECTION
 Create the forests on the map.

EXPORT void RemoveAllDefence (void) BUILD_SECTION
 Remove all the defences on the map.


Detailed Description

The routines for building.

This contains the declarations for all the functions for building that are used by other sections of the simulation

Definition in file build.h.


Typedef Documentation

typedef enum BuildCode BuildCode
 

The codes that are mapped for building items.

These items are aligned with the BUILD_* items in simcity.h to ease the mapping of buttons to items to build.


Enumeration Type Documentation

enum BuildCode
 

The codes that are mapped for building items.

These items are aligned with the BUILD_* items in simcity.h to ease the mapping of buttons to items to build.

Definition at line 25 of file build.h.


Function Documentation

EXPORT int Build_Bulldoze UInt16    xpos,
UInt16    ypos,
welem_t    _unused
 

Bulldoze a zone.

Parameters:
xpos  X position on the map
ypos  Y position on the map
_unused  unused.

Definition at line 291 of file build.c.

References blockSize(), BUILD_COST_BULLDOZER, Build_Destroy(), CantBulldoze(), getWorld(), LockZone(), lz_world, peOutOfMoney, RemoveDefence(), SpendMoney(), UInt16, UIProblemNotify(), UnlockZone(), welem_t, and WORLDPOS.

Referenced by button_press_event(), and motion_notify_event().

EXPORT void Build_Destroy UInt16    xpos,
UInt16    ypos
 

Attempt to destroy the item at the position in question.

Performed by the bulldoze and the auto bulldoze.

Parameters:
xpos  the X position on the map
ypos  the Y position on the map

Definition at line 330 of file build.c.

References AddGridUpdate, bc_coalplants, bc_count_commercial, bc_count_industrial, bc_count_rail, 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_rail, bc_value_residential, bc_value_roads, bc_waste, bc_water, bc_waterpipes, bc_waterpumps, Doff(), DrawCross(), getWorld(), GRID_ALL, IsArmyBase, IsCoalPlant, IsCommercial, IsFakeTree, IsFakeWater, IsFireStation, IsIndustrial, IsNukePlant, IsPoliceDept, IsPowerLine(), IsPowerWater(), IsPump, IsRail(), IsRailOvRoad(), IsRailPipe(), IsRailPower(), IsRailTunnel(), IsRealWater, IsResidential, IsRoad(), IsRoadBridge(), IsRoadPipe(), IsRoadPower(), IsWaste, IsWaterPipe(), RemoveDefence(), setWorldAndFlag(), UInt16, welem_t, WORLDPOS, and ZoneValue().

Referenced by Build_Bulldoze(), BurnField(), CreateMeteor(), CreateWaste(), DoCommitmentNasties(), and DoNastyStuffTo().

EXPORT int BuildSomething UInt16    xpos,
UInt16    ypos
 

Build something at the location specified.

Looks up the item in the buildStructure and builds it at the appropriate location.

Definition at line 93 of file build.c.

References AddGridUpdate, _bldStruct::bt, _bldStruct::func, GetGraphicNumber(), _bldStruct::gridsToUpdate, LockZone(), lz_world, _bldStruct::type, UIDisplayError1(), UIGetSelectedBuildItem(), UInt16, UIPaintMapField(), UIPaintMapStatus(), UnlockZone(), welem_t, and WORLDPOS.

Referenced by button_press_event(), and motion_notify_event().

EXPORT void CreateForests void   
 

Create the forests on the map.

Creates some "spraypainted" (someone called them that) forests throughout the `wilderness`

Definition at line 1109 of file build.c.

References CreateForest(), GetRandomNumber(), MapMul, UInt16, and UInt32.

Referenced by ConfigureNewGame().

EXPORT void CreateFullRiver void   
 

Create a river on the map.

Todo:
Make the river more interesting

Definition at line 1047 of file build.c.

References getMapHeight, getMapWidth, GetRandomNumber(), LockZone(), lz_flags, lz_world, setWorldAndFlag(), UInt16, UnlockZone(), and WORLDPOS.

Referenced by ConfigureNewGame().


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