#include <map.h>
Inheritance diagram for Map:
Public Member Functions | |
Map (const uint width, const uint height) | |
void | SaveTo (std::fstream &rfs) |
void | LoadFrom (std::fstream &rfs) |
OPENCITY_ERR_CODE | ChangeHeight (const uint &rcuiW, const uint &rcuiH, const OPENCITY_MAP_VARIATION &enumVar) |
void | SetLayer (const Layer *layer) |
const OC_BYTE & | GetLinearHeight (const uint &rcuiIndex) const |
const uint | GetMaxLinear () const |
void | GetSquareHeight (const uint &rcuiW, const uint &rcuiH, OC_BYTE tabH[]) const |
const signed char | GetSquareMinHeight (const uint &rcuiW, const uint &rcuiL) const |
const signed char | GetSquareMaxHeight (const uint &rcuiW, const uint &rcuiH) const |
const bool | IsSquarePlane (const uint &rcuiW, const uint &rcuiH) const |
const bool | IsSquareLinearPlane (const uint &rcuiLinearIndex) |
const bool | GetNeighbourWH (const uint &rcuiMapW, const uint &rcuiMapH, uint &ruiNbrW, uint &ruiNbrH, const OPENCITY_DIRECTION &enumDir) const |
void | GetPossibleWH (uint &rW, uint &rH, const int &deltaW, const int &deltaH) const |
Private Member Functions | |
void | _Linear2WH (const uint &linear, uint &w, uint &h) const |
uint | _WH2Linear (const uint &w, const uint &h, uint &linear) const |
Private Attributes | |
uint | _uiMapWidth |
uint | _uiMapHeight |
OC_BYTE * | _btabSquareHeight |
const Layer * | _pclayer |
we need this to know if a square can be safely raised up or lowered down |
Definition at line 33 of file map.h.
|
Convert the linear index to the square's W,H coordinates |
|
Convert the W,H coordinates to the linear index according to the datas stocked inside the class
Definition at line 355 of file map.cpp. Referenced by ChangeHeight(), and GetSquareHeight(). |
|
Change the square's OY heights. The square is designated by its W,H coordinates. ( OX, OZ OpenGL coordinates ) Definition at line 103 of file map.cpp. References _pclayer, _WH2Linear(), Layer::ContainStructure(), GetPossibleWH(), and GetSquareHeight(). |
|
Calculate the WH coordinates of the neighbour square given the direction
Definition at line 272 of file map.cpp. Referenced by BuildingLayer::_BuildPathStructure(). |
|
Calculate the new possible WH given the changes. If the delta values are too big to be incorporated in the new WH, the new WH values are cliped to the map edges Definition at line 318 of file map.cpp. Referenced by BuildingLayer::_DestroyStructure(), ChangeHeight(), and Simulator::CheckRange(). |
|
Get all the 4 heights of a square designated by its W,H. The corner's height is returned in the following order: left-up, left-down, right-down, right-up
Definition at line 187 of file map.cpp. References _WH2Linear(). Referenced by Renderer::_DisplayTerrain(), ChangeHeight(), GraphicManager::DisplayGC(), GraphicManager::DisplayStructure(), and GraphicManager::DisplayTerrain(). |
|
Load the data from the specified stream
Implements Persistence. Definition at line 83 of file map.cpp. Referenced by City::_Load(). |
|
Save the data to the specified fstream
Implements Persistence. Definition at line 68 of file map.cpp. Referenced by City::_Save(). |