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

Layer Class Reference

#include <layer.h>

Inheritance diagram for Layer:

Persistence UI BuildingLayer List of all members.

Public Member Functions

virtual const bool IsConstructive (uint W1, uint L1, uint W2, uint L2, const OPENCITY_STRUCTURE_CODE &enumStructCode) const =0
virtual const OPENCITY_ERR_CODE BuildPreview (const uint &W, const uint &L, const OPENCITY_STRUCTURE_CODE &enumStructCode, OPENCITY_GRAPHIC_CODE &enumGraphicCode) const =0
virtual const OPENCITY_ERR_CODE BuildStructure (const uint &W1, const uint &L1, const uint &W2, const uint &L2, const OPENCITY_STRUCTURE_CODE &enumStructCode, uint &rCost)=0
virtual const OPENCITY_ERR_CODE ResizeStructure (const uint &w, const uint &l, const OPENCITY_GRAPHIC_CODE &oldGC)=0
virtual const OPENCITY_ERR_CODE DestroyStructure (uint W1, uint L1, uint W2, uint L2, uint &rCost)=0
virtual StructureGetLinearStructure (const uint cuiLinearIndex) const =0
virtual StructureGetStructure (const uint &w, const uint &l) const =0
virtual StructureGetRandomStructure (uint &w, uint &l, const OPENCITY_STRUCTURE_CODE &enumStructCode=OC_STRUCTURE_UNDEFINED) const =0
virtual const uint GetNumberStructure () const =0
const uint GetMaxLinear () const
void GetLayerSize (uint &w, uint &l) const
virtual void StructureSet (const OC_BYTE &status)=0
virtual void StructureUnset (const OC_BYTE &status)=0
virtual const bool ContainStructure (const uint &W1, const uint &L1, const uint &W2, const uint &L2, const OPENCITY_STRUCTURE_CODE &enumStructCode) const =0
virtual const bool ContainStructureOnly (const uint &W1, const uint &L1, const uint &W2, const uint &L2, const OPENCITY_STRUCTURE_CODE &enumStructCode) const =0
virtual GUIContainerQueryStructure (const uint &w, const uint &l) const =0

Protected Attributes

uint _uiLayerWidth
uint _uiLayerLength

Static Protected Attributes

static uint uiNumberLayer = 0
 total derived classes
static GUIButtonpbtnQW
 Water query button.
static GUIButtonpbtnQE
 Electricity query button.
static GUIButtonpbtnQG
 Gas query button.
static GUIButtonpbtnQR
 Residential query button.
static GUIButtonpbtnQC
 Commercial query button.
static GUIButtonpbtnQI
 Industrial query button.
static GUIButtonpbtnQP
 Path query button.

Detailed Description

This is the interface of all other layer classes. A layer is persistent and should handle the user interface commands.

Definition at line 37 of file layer.h.


Member Function Documentation

virtual const OPENCITY_ERR_CODE Layer::BuildPreview const uint &  W,
const uint &  L,
const OPENCITY_STRUCTURE_CODE &  enumStructCode,
OPENCITY_GRAPHIC_CODE &  enumGraphicCode
const [pure virtual]
 

Preview the structure which is about to be built on the specified surface.

Parameters:
W,L The upper left corner of the surface which will be used to build the bulding.
enumGraphicCode Will contain the OC graphic code of the building
enumStructCode Contain the structure code
See also:
IsConstructive()

BuildStructure()

Implemented in BuildingLayer.

virtual const OPENCITY_ERR_CODE Layer::BuildStructure const uint &  W1,
const uint &  L1,
const uint &  W2,
const uint &  L2,
const OPENCITY_STRUCTURE_CODE &  enumStructCode,
uint &  rCost
[pure virtual]
 

Build the specified structure on the surface Precondition: the specified surface must be "constructive". This is checked by the method "IsConstructive()"

See also:
IsConstructive()

Implemented in BuildingLayer.

virtual const bool Layer::ContainStructure const uint &  W1,
const uint &  L1,
const uint &  W2,
const uint &  L2,
const OPENCITY_STRUCTURE_CODE &  enumStructCode
const [pure virtual]
 

Does the specified surface contain _at least_ one required structure ?

Implemented in BuildingLayer.

Referenced by Map::ChangeHeight().

virtual const bool Layer::ContainStructureOnly const uint &  W1,
const uint &  L1,
const uint &  W2,
const uint &  L2,
const OPENCITY_STRUCTURE_CODE &  enumStructCode
const [pure virtual]
 

Does the specified surface contain _only_ the required structure or nothing ?

Implemented in BuildingLayer.

virtual const OPENCITY_ERR_CODE Layer::DestroyStructure uint  W1,
uint  L1,
uint  W2,
uint  L2,
uint &  rCost
[pure virtual]
 

Destroy _all_ the structures built on the surface. If the specified surface is a part of a bigger structure, the big main structure is also destroyed.

Implemented in BuildingLayer.

void Layer::GetLayerSize uint &  w,
uint &  l
const
 

Get the layer size.

Note:
This method is obsolete
See also:
GlobalVar

Definition at line 88 of file layer.cpp.

Referenced by Simulator::CheckLevelDown(), and Simulator::CheckLevelUp().

virtual Structure* Layer::GetLinearStructure const uint  cuiLinearIndex  )  const [pure virtual]
 

Fast access to the structure by its internal linear index. There's no error checking.

Parameters:
cuiLinearIndex The linear index of the structure to access. It starts from 0.

Implemented in BuildingLayer.

Referenced by Renderer::Display().

virtual const uint Layer::GetNumberStructure  )  const [pure virtual]
 

Get the number of the structures built on the layer

Implemented in BuildingLayer.

virtual Structure* Layer::GetRandomStructure uint &  w,
uint &  l,
const OPENCITY_STRUCTURE_CODE &  enumStructCode = OC_STRUCTURE_UNDEFINED
const [pure virtual]
 

Random access to the structure of the specified type

Parameters:
w,l The structure NorthWest (top left) coordinates
enumStructCode The structure code
Returns:
The randomly selected structure pointer

Implemented in BuildingLayer.

virtual Structure* Layer::GetStructure const uint &  w,
const uint &  l
const [pure virtual]
 

Access to the structure specified by its WL coordinates

Parameters:
w,l The structure NorthWest (top left) coordinates

Implemented in BuildingLayer.

virtual const bool Layer::IsConstructive uint  W1,
uint  L1,
uint  W2,
uint  L2,
const OPENCITY_STRUCTURE_CODE &  enumStructCode
const [pure virtual]
 

Is the surface ( w1, l1, w2, l2 ) constructive ? Is there something built on it already ?

Implemented in BuildingLayer.

virtual GUIContainer* Layer::QueryStructure const uint &  w,
const uint &  l
const [pure virtual]
 

This methods returns a pointer to a container which contains the queried informations. The user must call "delete pointer" to destroy that pointer once he/she've done with it.

Implemented in BuildingLayer.

virtual const OPENCITY_ERR_CODE Layer::ResizeStructure const uint &  w,
const uint &  l,
const OPENCITY_GRAPHIC_CODE &  oldGC
[pure virtual]
 

Resize the surface used by the structure to the new surface thanks to its new GraphicCode.

Parameters:
w,l The NorthWest (top left) coordinates of the structure
oldGC The old graphic code

Implemented in BuildingLayer.

virtual void Layer::StructureSet const OC_BYTE &  status  )  [pure virtual]
 

Set the status of all structures

Parameters:
status The new status of the structures

Implemented in BuildingLayer.

virtual void Layer::StructureUnset const OC_BYTE &  status  )  [pure virtual]
 

Unset the status of all structures

Parameters:
status The status to unset

Implemented in BuildingLayer.


Member Data Documentation

GUIButton * Layer::pbtnQW [static, protected]
 

Water query button.

Used by the "Query" function these controls are shared by all the derived layers

Definition at line 27 of file layer.cpp.

Referenced by BuildingLayer::QueryStructure().


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