#include <city.h>
Inheritance diagram for City:
Public Member Functions | |
City (const uint width=OC_CITY_W, const uint length=OC_CITY_L, const OC_DATE foundedDate=0, const int difficulty=2) | |
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) |
void | SetCurrentLayer (OPENCITY_CITY_LAYER enumNewLayer) |
void | Run (OPENCITY_CITY_SPEED enumSpeed=LAST_SPEED) |
Layer * | GetLayer (OPENCITY_CITY_LAYER enumLayer) const |
const void | GetWL (uint &w, uint &l) const |
Private Member Functions | |
void | _CreateSimulator () |
void | _DeleteSimulator () |
void | _CreateGUI () |
void | _DeleteGUI () |
void | _DoTool (const SDL_MouseButtonEvent &sdlMBEvent) |
bool | _HandleKeyPressed () |
void | _DoBill (const OPENCITY_PROPERTY_CODE &) |
void | _HandleGUIClick () |
void | _HandleMouseXY () |
void | _TestPathfinding () |
void | _BuildPreview () |
bool | _Save (const string &strFilename) |
bool | _Load (const string &strFilename) |
Private Attributes | |
string | strCityName |
The name of the city. | |
int | iDifficulty |
The difficulty of current game. | |
string | strFileName |
The fileName of current city. | |
OC_DATE | cityFoundedDate |
OC_LINT | _liCityFund |
Money, money, money ! | |
bool | boolModified |
uint | _uiDay |
uint | _uiMonth |
uint | _uiYear |
OC_CHAR | _cTool |
Tool hotkey. | |
uint | _uiWidth |
City's width, length. | |
uint | _uiLength |
int | iWinWidth |
Windows' width, height. | |
int | iWinHeight |
bool | boolLMBPressed |
uint | uiMapW1 |
uint | uiMapL1 |
uint | uiMapW2 |
uint | uiMapL2 |
bool | booltabKeyPressed [KEY_NUMBER] |
OPENCITY_CITY_LAYER | enumCurrentLayer |
OPENCITY_CITY_SPEED | enumCurrentSpeed |
OPENCITY_TOOL_CODE | enumCurrentTool |
Layer * | ptabLayer [4] |
bool | boolPathGo |
uint | uiPathStartW |
uint | uiPathStartH |
uint | uiPathStopW |
uint | uiPathStopH |
GUIContainer * | pctrPath |
GUIButton * | pbtnPathStart |
GUIButton * | pbtnPathStop1 |
GUIButton * | pbtnPathStop2 |
GUIButton * | pbtnTestBuilding |
Vehicle * | pvehicle |
uint | uiVehicleType |
GUIContainer * | pctrMAS |
GUIButton * | pbtnMAS |
GUIButton * | pbtnMASPolice |
GUIButton * | pbtnMASDemonstrator |
GUIButton * | pbtnMASRobber |
MainSim * | _pMSim |
SDL_Thread * | _pthreadMSim |
GUIButton * | pbtnSplash |
GUIContainer * | pctr |
GUIContainer * | pctrMain |
GUIContainer * | pctrL |
GUIContainer * | pctrT |
GUIContainer * | pctrQ |
GUIContainer * | pctrZ |
GUIContainer * | pctrG |
GUIContainer * | pctrN |
GUIContainer * | pctrS |
GUIButton * | pbtnZ |
GUIButton * | pbtnS |
GUIButton * | pbtnL |
GUIButton * | pbtnP |
GUIButton * | pbtnX |
GUIButton * | pbtnG |
GUIButton * | pbtnZB |
GUIButton * | pbtnZR |
GUIButton * | pbtnZC |
GUIButton * | pbtnZI |
GUIButton * | pbtnLB |
GUIButton * | pbtnLL |
GUIButton * | pbtnLE |
GUIButton * | pbtnTB |
GUIButton * | pbtnTU |
GUIButton * | pbtnTD |
GUIButton * | pbtnTX |
GUIButton * | pbtnTQ |
GUIButton * | pbtnGB |
GUIButton * | pbtnGP |
GUIButton * | pbtnGE |
GUIButton * | pbtnGH |
GUIButton * | pbtnGL |
GUIButton * | pbtnGF |
GUIButton * | pbtnNB |
GUIButton * | pbtnNP |
GUIButton * | pbtnNT |
GUIButton * | pbtnSB |
GUIButton * | pbtnSS |
GUIButton * | pbtnSL |
Definition at line 44 of file city.h.
|
Create the Graphic User Interface or ToolCircle
Definition at line 823 of file city.cpp. References GUIContainer::Add(). |
|
Create all the threads which handle the simulation aspect
Definition at line 786 of file city.cpp. References GlobalVar::gpMapMgr, GlobalVar::gpmutexSim, and MainSim::Run(). |
|
Free the memory used by the GUI
|
|
Wait for the simulation thread's exit
Definition at line 806 of file city.cpp. References MainSim::Return(). |
|
Save the game
Definition at line 1815 of file city.cpp. References _uiWidth, MainSim::AddStructure(), Renderer::boolHeightChange, GlobalVar::gpMapMgr, GlobalVar::gpMoveMgr, GlobalVar::gpmutexSim, GlobalVar::gpRenderer, MainSim::LoadFrom(), Persistence::LoadFrom(), Map::LoadFrom(), LoadFrom(), MainSim::RefreshSimValue(), and MovementManager::Remove(). |
|
Save the game
Definition at line 1780 of file city.cpp. References GlobalVar::gpMapMgr, GlobalVar::gpmutexSim, MainSim::SaveTo(), Persistence::SaveTo(), Map::SaveTo(), and SaveTo(). |
|
Load the data from the specified stream
Implements Persistence. Definition at line 158 of file city.cpp. References _liCityFund, and _uiWidth. Referenced by _Load(). |
|
Save the data to the specified fstream
Implements Persistence. Definition at line 143 of file city.cpp. References _liCityFund, and _uiWidth. Referenced by _Save(). |