Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

PropertyManager Class Reference

#include <propertymanager.h>

List of all members.

Public Member Functions

const int Get (const OPENCITY_PROPERTY_CODE &pCode, const OPENCITY_STRUCTURE_CODE &sCode, const Structure *pcStruct=NULL) const
const OPENCITY_GRAPHIC_CODE GetGC (const OPENCITY_STRUCTURE_CODE scode) const
const OPENCITY_STRUCTURE_TYPE GetST (const OPENCITY_STRUCTURE_CODE scode) const
void GetWLH (const OPENCITY_GRAPHIC_CODE &gcode, uint &w, const uint defw, uint &l, const uint defl, uint &h, const uint defh)

Private Member Functions

const string propertymanagerGetStr (const OPENCITY_GRAPHIC_CODE &gcode, const string &key, const string &def="")
const OPENCITY_ERR_CODE propertymanagerGetLint (const OPENCITY_GRAPHIC_CODE &gcode, const string &key, OC_LINT &rlint, const OC_LINT &def=0)

Private Attributes

std::vector< Conf * > vpConf
 Models' configuration files.


Detailed Description

This manager handles specially the models' .conf files. When an instance is created, it reads the "graphism.conf" file and load all the associated models' .conf files for later use. If a .conf file is not found for a specific model, the manager just silently ignores the problem. It's the programmer's responsability to not query that .conf, otherwise, the manager will crash.

Definition at line 38 of file propertymanager.h.


Member Function Documentation

const int PropertyManager::Get const OPENCITY_PROPERTY_CODE &  pCode,
const OPENCITY_STRUCTURE_CODE &  sCode,
const Structure pcStruct = NULL
const
 

Returns the requested property of the structure

Parameters:
pCode The code of the requested property
sCode The structure code
pcStruct The pointer to the structure (optional)
Returns:
The value of the requested property
See also:
enum.h for more details about the parameters

Definition at line 98 of file propertymanager.cpp.

References Structure::GetLevel().

Referenced by BuildingLayer::_BuildPathStructure(), and BuildingLayer::_DestroyStructure().

const OPENCITY_GRAPHIC_CODE PropertyManager::GetGC const OPENCITY_STRUCTURE_CODE  scode  )  const
 

Return the _first_ level graphic code for the corresponding structure code

Parameters:
scode The structure code of the structure that you want to retrieve the graphic code.
Returns:
The corresponding graphic code

Definition at line 225 of file propertymanager.cpp.

Referenced by BuildingLayer::BuildPreview().

const OPENCITY_STRUCTURE_TYPE PropertyManager::GetST const OPENCITY_STRUCTURE_CODE  scode  )  const
 

Return the structure type from its structure code. This is used for serialization.

Definition at line 297 of file propertymanager.cpp.

void PropertyManager::GetWLH const OPENCITY_GRAPHIC_CODE &  gcode,
uint &  w,
const uint  defw,
uint &  l,
const uint  defl,
uint &  h,
const uint  defh
 

Return the structure's "width, length, and height" parameter

Parameters:
gcode The graphic code of the structure that you want to retrieve the properties
w Structure's width (OpenGL Ox)
l Structure's length (OpenGL Oz)
h Structure's height (OpenGL Oy)
defw,defl,defh contain the default values for w, l and h respectively
Returns:
the value pointed by the given "key"

Definition at line 352 of file propertymanager.cpp.

Referenced by BuildingLayer::_DestroyStructure(), BuildingLayer::_LoadStructure(), BuildingLayer::BuildPreview(), Simulator::CheckLevelDown(), Simulator::CheckLevelUp(), Renderer::DisplayBuildPreview(), and BuildingLayer::ResizeStructure().

const string PropertyManager::propertymanagerGetStr const OPENCITY_GRAPHIC_CODE &  gcode,
const string &  key,
const string &  def = ""
[private]
 

Return the string which represents the value part of the (key-value) pair of the structure code given in parameter.

Parameters:
gcode The OpenCity graphic code of the structure that you want to retrieve the parameter
key The key of the element that you what to retrieve the value
def Default value
Returns:
the value pointed by the given "key"

Definition at line 383 of file propertymanager.cpp.


The documentation for this class was generated from the following files:
Generated on Sat Nov 11 10:21:11 2006 for OpenCity by  doxygen 1.4.2