MicropolisEngine/src/tool.cpp File Reference

#include "stdafx.h"
#include "micropolis.h"
#include "text.h"
#include "tool.h"
#include "stubs.h"

Go to the source code of this file.

Functions

static short checkBigZone (MapTile id, short *deltaHPtr, short *deltaVPtr)

Variables

static const short gCostOf []
static const short gToolSize []
static short idArray [29]
static const BuildingProperties residentialZoneBuilding
static const BuildingProperties commercialZoneBuilding
static const BuildingProperties industrialZoneBuilding
static const BuildingProperties policeStationBuilding
static const BuildingProperties fireStationBuilding
static const BuildingProperties stadiumBuilding
static const BuildingProperties coalPowerBuilding
static const BuildingProperties nuclearPowerBuilding
static const BuildingProperties seaportBuilding
static const BuildingProperties airportBuilding


Detailed Description

Definition in file tool.cpp.


Function Documentation

static short checkBigZone ( MapTile  id,
short *  deltaHPtr,
short *  deltaVPtr 
) [static]

Compute where the 'center' (at (1,1)) of the zone is, depending on where the user clicked.

Only inner tiles are recognized, and possibly not even complete (ie stadium while game is playing).

Parameters:
id Tile character value of the tile that the user clicked on.
deltaHPtr Pointer where horizontal position correction is written to.
deltaVPtr Pointer where vertical position correction is written to.
Returns:
Size of the zone clicked at (or 0 if clicked outside zone).
Todo:
Make this table driven.

Definition at line 394 of file tool.cpp.

References COALSMOKE3, NUCLEAR, PORT, POWERPLANT, and STADIUM.

Referenced by Micropolis::bulldozerTool().


Variable Documentation

Initial value:

    BuildingProperties(6, 6, AIRPORTBASE, TOOL_AIRPORT, "Airp", false)
Building properties of a airport.

Definition at line 1250 of file tool.cpp.

Initial value:

    BuildingProperties(4, 4, COALBASE, TOOL_COALPOWER, "Coal", false)
Building properties of a coal power station.

Definition at line 1238 of file tool.cpp.

Initial value:

    BuildingProperties(3, 3, COMBASE, TOOL_COMMERCIAL, "Com", false)
Building properties of a commercial zone.

Definition at line 1218 of file tool.cpp.

Initial value:

    BuildingProperties(3, 3, FIRESTBASE, TOOL_FIRESTATION, "Fire", false)
Building properties of a fire station.

Definition at line 1230 of file tool.cpp.

const short gCostOf[] [static]

Initial value:

 {
     100,    100,    100,    500, 
     500,      0,      5,      1, 
      20,     10,   5000,     10, 
    3000,   3000,   5000,  10000, 
     100,      0,      0,      0, 
       0,
}
Cost of each tool. Maybe move this information to eg BuildingProperties?

Definition at line 208 of file tool.cpp.

const short gToolSize[] [static]

Initial value:

 {
    3, 3, 3, 3,
    3, 1, 1, 1,
    1, 1, 4, 1,
    4, 4, 4, 6,
    1, 1, 1, 1,
    0,
}
Size of each tool.
Note:
Actually it is the size of the building rather than the tool.
Todo:
This information is duplicated in the BuildingProperties at least.

Definition at line 222 of file tool.cpp.

short idArray[29] [static]

Initial value:

 {
    DIRT, RIVER, TREEBASE, RUBBLE,
    FLOOD, RADTILE, FIRE, ROADBASE,
    POWERBASE, RAILBASE, RESBASE, COMBASE,
    INDBASE, PORTBASE, AIRPORTBASE, COALBASE,
    FIRESTBASE, POLICESTBASE, STADIUMBASE, NUCLEARBASE,
    
    HBRDG0, RADAR0, FOUNTAIN, INDBASE2,
    
    FOOTBALLGAME1, VBRDG0, 952, 956,
    9999, 
}

Definition at line 735 of file tool.cpp.

Initial value:

    BuildingProperties(3, 3, INDBASE, TOOL_INDUSTRIAL, "Ind", false)
Building properties of a industrial zone.

Definition at line 1222 of file tool.cpp.

Initial value:

    BuildingProperties(4, 4, NUCLEARBASE, TOOL_NUCLEARPOWER, "Nuc", true)
Building properties of a nuclear power station.

Definition at line 1242 of file tool.cpp.

Initial value:

    BuildingProperties(3, 3, POLICESTBASE, TOOL_POLICESTATION, "Pol", false)
Building properties of a police station.

Definition at line 1226 of file tool.cpp.

Initial value:

    BuildingProperties(3, 3, RESBASE, TOOL_RESIDENTIAL, "Res", false)
Building properties of a residential zone.

Definition at line 1214 of file tool.cpp.

Initial value:

    BuildingProperties(4, 4, PORTBASE, TOOL_SEAPORT, "Seap", false)
Building properties of a seaport.

Definition at line 1246 of file tool.cpp.

Initial value:

    BuildingProperties(4, 4, STADIUMBASE, TOOL_STADIUM, "Stad", false)
Building properties of a stadium.

Definition at line 1234 of file tool.cpp.


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