#include <buildinglayer.h>
Inheritance diagram for BuildingLayer:

Public Member Functions | |
| BuildingLayer (const City &rcCity) | |
| void | SaveTo (std::fstream &rfs) |
| void | LoadFrom (std::fstream &rfs) |
| void | uiKeyboard (const SDL_KeyboardEvent &rcsSDLKeyboardEvent) |
| void | uiMouseMotion (const SDL_MouseMotionEvent &rcsSDLMouseMotionEvent) |
| void | uiMouseButton (const SDL_MouseButtonEvent &rcsSDLMouseButtonEvent) |
| void | uiExpose (const SDL_ExposeEvent &rcsSDLExposeEvent) |
| void | uiResize (const SDL_ResizeEvent &rcsSDLResizeEvent) |
| const bool | IsConstructive (uint W1, uint L1, uint W2, uint L2, const OPENCITY_STRUCTURE_CODE &enumStructCode) const |
| const OPENCITY_ERR_CODE | BuildPreview (const uint &W, const uint &L, const OPENCITY_STRUCTURE_CODE &enumStructCode, OPENCITY_GRAPHIC_CODE &enumGraphicCode) const |
| const OPENCITY_ERR_CODE | BuildStructure (const uint &W1, const uint &L1, const uint &W2, const uint &L2, const OPENCITY_STRUCTURE_CODE &enumStructCode, uint &rCost) |
| const OPENCITY_ERR_CODE | ResizeStructure (const uint &w, const uint &l, const OPENCITY_GRAPHIC_CODE &oldGC) |
| const OPENCITY_ERR_CODE | DestroyStructure (uint W1, uint L1, uint W2, uint L2, uint &rCost) |
| Structure * | GetLinearStructure (const uint cuiLinearIndex) const |
| Structure * | GetStructure (const uint &w, const uint &l) const |
| Structure * | GetRandomStructure (uint &w, uint &l, const OPENCITY_STRUCTURE_CODE &enumStructCode=OC_STRUCTURE_UNDEFINED) const |
| const uint | GetNumberStructure () const |
| void | StructureSet (const OC_BYTE &status) |
| void | StructureUnset (const OC_BYTE &status) |
| const bool | ContainStructure (const uint &W1, const uint &L1, const uint &W2, const uint &L2, const OPENCITY_STRUCTURE_CODE &enumStructCode) const |
| const bool | ContainStructureOnly (const uint &W1, const uint &L1, const uint &W2, const uint &L2, const OPENCITY_STRUCTURE_CODE &enumStructCode) const |
| GUIContainer * | QueryStructure (const uint &w, const uint &l) const |
Private Member Functions | |
| const bool | _IsPathConstructive (const uint &w, const uint &h, const OPENCITY_STRUCTURE_CODE &enumStructCode) const |
| const OPENCITY_ERR_CODE | _BuildPathStructure (uint W1, uint L1, uint W2, uint L2, const OPENCITY_STRUCTURE_CODE &enumStructCode, uint &rCost) |
| void | _BuildPathStructure (const uint &w, const uint &h, const uint &linearIndex, const OPENCITY_STRUCTURE_CODE &enumStructCode, uint &rCost) |
| const OPENCITY_ERR_CODE | _BuildRCIStructure (uint W1, uint L1, uint W2, uint L2, const OPENCITY_STRUCTURE_CODE &enumStructCode, uint &rCost) |
| const OPENCITY_ERR_CODE | _BuildFloraStructure (uint W1, uint L1, uint W2, uint L2, const OPENCITY_STRUCTURE_CODE &enumStructCode, uint &rCost) |
| const OPENCITY_ERR_CODE | _BuildWEGStructure (uint W1, uint L1, const OPENCITY_STRUCTURE_CODE &enumStructCode, uint &rCost) |
| void | _BuildWEGStructure (uint W1, uint L1, uint W2, uint L2, const OPENCITY_STRUCTURE_CODE &enumStructCode, uint &rCost) |
| void | _LoadStructure (const uint &w1, const uint &l1, Structure *pStruct) |
| const OPENCITY_ERR_CODE | _DestroyStructure (const uint &w, const uint &l, uint &rCost) |
| const OPENCITY_ERR_CODE | _DestroyPathStructure (uint w, uint l, const OPENCITY_STRUCTURE_CODE &enumStructCode) |
Private Attributes | |
| Structure ** | _tabpStructure |
Definition at line 31 of file buildinglayer.h.
|
||||||||||||||||||||||||
|
Build a path structure at the specified coordinates
Definition at line 924 of file buildinglayer.cpp. References _tabpStructure, PathStructure::AddNeighbour(), PropertyManager::Get(), Structure::GetCode(), Map::GetNeighbourWH(), GetStructure(), GlobalVar::gpMapMgr, and GlobalVar::gpPropertyMgr. |
|
||||||||||||||||||||||||||||
|
Called internally by other methods, don't touch it Definition at line 842 of file buildinglayer.cpp. Referenced by BuildStructure(). |
|
||||||||||||||||
|
Destroy the structure built at the specified coordinates
Definition at line 1233 of file buildinglayer.cpp. References _tabpStructure, PropertyManager::Get(), Structure::GetCode(), Structure::GetGraphicCode(), Structure::GetMain(), Map::GetPossibleWH(), PropertyManager::GetWLH(), GlobalVar::gpMapMgr, and GlobalVar::gpPropertyMgr. Referenced by DestroyStructure(), and ResizeStructure(). |
|
||||||||||||||||
|
Fast load a structure at the specified coordinates. If the structure is bigger than 1x1, then extra structures part will be built automatically. There is not any "Constructive" test.
Definition at line 1181 of file buildinglayer.cpp. References _tabpStructure, Structure::GetGraphicCode(), PropertyManager::GetWLH(), and GlobalVar::gpPropertyMgr. Referenced by LoadFrom(). |
|
||||||||||||||||||||
|
see "layer.h" for more informations
Implements Layer. Definition at line 274 of file buildinglayer.cpp. References PropertyManager::GetGC(), PropertyManager::GetWLH(), GlobalVar::gpPropertyMgr, and IsConstructive(). |
|
||||||||||||||||||||||||||||
|
see "layer.h" for more informations
Implements Layer. Definition at line 313 of file buildinglayer.cpp. References _BuildPathStructure(). Referenced by ResizeStructure(). |
|
||||||||||||||||||||||||
|
see "layer.h" for more informations Implements Layer. Definition at line 595 of file buildinglayer.cpp. References Structure::GetCode(), GetLinearStructure(), and Structure::IsSet(). Referenced by Simulator::CheckRange(). |
|
||||||||||||||||||||||||
|
see "layer.h" for more informations Implements Layer. Definition at line 663 of file buildinglayer.cpp. References Structure::GetCode(), GetLinearStructure(), and Structure::IsSet(). |
|
||||||||||||||||||||||||
|
Destroy all the structures built on the specified surface
Implements Layer. Definition at line 479 of file buildinglayer.cpp. References _DestroyStructure(). |
|
|
Returns a pointer to a structure indexed by its linear index. The linear index of a structure is calculated by this formula: index = W + (H * city width)
Implements Layer. Definition at line 503 of file buildinglayer.cpp. References _tabpStructure. Referenced by ContainStructure(), ContainStructureOnly(), PathFinder::findShortestPath(), GetRandomStructure(), and MainSim::RefreshSimValue(). |
|
|
Get the number of the structures built on the layer Implements Layer. Definition at line 558 of file buildinglayer.cpp. |
|
||||||||||||||||
|
Random access to the structure of the specified type
Implements Layer. Definition at line 521 of file buildinglayer.cpp. References Structure::GetCode(), and GetLinearStructure(). |
|
||||||||||||
|
Access to the structure specified by its WL coordinates
Implements Layer. Definition at line 511 of file buildinglayer.cpp. References _tabpStructure. Referenced by _BuildPathStructure(), and PathFinder::findShortestPath(). |
|
||||||||||||||||||||||||
|
Is the specified area constructive ? Can we build the specified structure on it ?
Implements Layer. Definition at line 210 of file buildinglayer.cpp. References GlobalVar::gpMapMgr, and Map::IsSquarePlane(). Referenced by BuildPreview(). |
|
|
Load the data from the specified stream
Implements Persistence. Definition at line 106 of file buildinglayer.cpp. References _LoadStructure(), _tabpStructure, Structure::LoadFrom(), and Structure::SetNumber(). |
|
||||||||||||
|
see "layer.h" for more informations Implements Layer. Definition at line 739 of file buildinglayer.cpp. References _tabpStructure, GUIContainer::Add(), Structure::IsSet(), Layer::pbtnQC, Layer::pbtnQE, Layer::pbtnQG, Layer::pbtnQI, Layer::pbtnQR, Layer::pbtnQW, and GUIButton::SetBackground(). |
|
||||||||||||||||
|
Resize the surface used by the structure to the new surface thanks to its new GraphicCode.
Implements Layer. Definition at line 365 of file buildinglayer.cpp. References _DestroyStructure(), _tabpStructure, BuildStructure(), Structure::GetCode(), Structure::GetGraphicCode(), Structure::GetMain(), PropertyManager::GetWLH(), and GlobalVar::gpPropertyMgr. |
|
|
Save the data to the specified fstream
Implements Persistence. Definition at line 74 of file buildinglayer.cpp. References _tabpStructure, Structure::GetMain(), Structure::GetType(), and Structure::SaveTo(). |
|
|
Set all the structures contained by this layer to the specified status.
Implements Layer. Definition at line 569 of file buildinglayer.cpp. References _tabpStructure, and Structure::Set(). |
|
|
Unset the specified status of all the structures contained by this layer.
Implements Layer. Definition at line 582 of file buildinglayer.cpp. References _tabpStructure, and Structure::Unset(). |
|
|
All the buildings are here Definition at line 226 of file buildinglayer.h. Referenced by _BuildPathStructure(), _DestroyStructure(), _LoadStructure(), GetLinearStructure(), GetStructure(), LoadFrom(), QueryStructure(), ResizeStructure(), SaveTo(), StructureSet(), and StructureUnset(). |
1.4.2