CorridorCell Class Reference

#include <CorridorCell.h>

Inheritance diagram for CorridorCell:

Inheritance graph
[legend]
Collaboration diagram for CorridorCell:

Collaboration graph
[legend]

Public Member Functions

 CorridorCell (unsigned int size_max)
 Constructor of a new CorridorCell.
virtual ~CorridorCell ()
 Empty destructor of CorridorCell.
void setSize_max (unsigned int new_size)
unsigned int getSize_max ()
virtual bool reachable (Worshiper *w)
 Is the Cell reachable ?

Protected Member Functions

virtual GLuint getTexName ()
 Return the Cell texture id.

Protected Attributes

unsigned int _size_max

Static Protected Attributes

static GLuint _tex_name = 0

Detailed Description

< A limited access Cell

Definition at line 33 of file CorridorCell.h.


Constructor & Destructor Documentation

CorridorCell::CorridorCell ( unsigned int  size_max  ) 

Constructor of a new CorridorCell.

Parameters:
size_max the size max of the worshipers that can access that Cell

Definition at line 41 of file CorridorCell.cpp.

00041                                                 :
00042     ReachableCell(), _size_max(size_max) {
00043 
00044 }


Member Function Documentation

GLuint CorridorCell::getTexName (  )  [protected, virtual]

Return the Cell texture id.

Returns:
the value of _tex_name

Reimplemented from Cell.

Definition at line 32 of file CorridorCell.cpp.

References _tex_name, and Image::genTexture2D().

00032                                 {
00033   if(_tex_name == 0) {
00034     Image texture("./textures/CorridorCell.bmp");
00035     _tex_name = texture.genTexture2D();
00036   }
00037 
00038   return _tex_name;
00039 }

Here is the call graph for this function:

void CorridorCell::setSize_max ( unsigned int  new_size  ) 

Set the value of _size_max

Parameters:
new_size the new value of _size_max

Definition at line 50 of file CorridorCell.cpp.

References _size_max.

00050                                                     {
00051   _size_max = new_size;
00052 }

unsigned int CorridorCell::getSize_max (  ) 

Get the value of _size_max

Returns:
the value of _size_max

Definition at line 54 of file CorridorCell.cpp.

References _size_max.

00054                                        {
00055   return _size_max;
00056 }

bool CorridorCell::reachable ( Worshiper w  )  [virtual]

Is the Cell reachable ?

Parameters:
w the Worshiper that try to access to the Cell
Returns:
true if the Worshiper can access to the Cell, false otherwise

Reimplemented from ReachableCell.

Definition at line 58 of file CorridorCell.cpp.

References _size_max, Worshiper::getSize(), and ReachableCell::reachable().

00058                                          {
00059   return ReachableCell::reachable(w) && (w->getSize() <= _size_max);
00060 }

Here is the call graph for this function:


Field Documentation

GLuint CorridorCell::_tex_name = 0 [static, protected]

the texture id for Cell rendering

Reimplemented from Cell.

Definition at line 38 of file CorridorCell.h.

Referenced by getTexName().

unsigned int CorridorCell::_size_max [protected]

the size max of the worshipers that can access that Cell

Definition at line 41 of file CorridorCell.h.

Referenced by getSize_max(), reachable(), and setSize_max().


The documentation for this class was generated from the following files:
Generated on Sat Feb 2 22:23:10 2008 for Teapot Colony Wars by  doxygen 1.5.4