CorpseFood Class Reference

#include <CorpseFood.h>

Inheritance diagram for CorpseFood:

Inheritance graph
[legend]
Collaboration diagram for CorpseFood:

Collaboration graph
[legend]

Public Member Functions

 CorpseFood (unsigned int value)
 Constructor of a new CorpseFood.
virtual ~CorpseFood ()
 Empty CorpseFood destructor.
virtual Cell * makeActions ()
 Make the actions needed by the Cell for one iteration.

Protected Member Functions

virtual GLuint getTexName ()
 Return the Cell texture id.

Static Protected Attributes

static GLuint _tex_name = 0

Detailed Description

< A Cell that contains dead bodies

Definition at line 33 of file CorpseFood.h.


Constructor & Destructor Documentation

CorpseFood::CorpseFood ( unsigned int  value  ) 

Constructor of a new CorpseFood.

Parameters:
value the amount of food in the CorpseFood

Definition at line 40 of file CorpseFood.cpp.

00040                                          :
00041     FoodCell(value, 0, value) {
00042 
00043 }


Member Function Documentation

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

Return the Cell texture id.

Returns:
the value of _tex_name

Reimplemented from Cell.

Definition at line 31 of file CorpseFood.cpp.

References _tex_name, and Image::genTexture2D().

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

Here is the call graph for this function:

Cell * CorpseFood::makeActions (  )  [virtual]

Make the actions needed by the Cell for one iteration.

Returns:
a pointer to the new Cell which should replace this one

Reimplemented from FoodCell.

Definition at line 49 of file CorpseFood.cpp.

References FoodCell::getFood(), FoodCell::makeActions(), and ReachableCell::pop().

00049                               {
00050   FoodCell::makeActions();
00051 
00052   return (getFood() > 0 ? this : pop());
00053 }

Here is the call graph for this function:


Field Documentation

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

the texture id for Cell rendering

Reimplemented from Cell.

Definition at line 38 of file CorpseFood.h.

Referenced by getTexName().


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