#include <Field.h>
Inherits Object.
Inheritance diagram for Field:


Public Member Functions | |
| Field () | |
| Standard constructor. | |
| virtual | ~Field () |
| Standard destructor. | |
| int | renderChild (Vector3d p_pos, Level *p_level, double p_deltasize=1.0) |
| Renders the Object on the field at the given position. | |
| int | select (std::string p_filename) |
| Selects the Texture to aply corresponding to energy value. | |
| virtual int | render (Vector3d p_pos, double p_deltasize=1.0) |
| Renders the texture. | |
| virtual Field * | getField () |
| Returns a pointer to itself. | |
Public Attributes | |
| Unit * | unit |
| Holds the Object on the Field. | |
| int | energy |
| Holds the energy of the field. | |
| int | xCoord |
| Holds the x-coordinate in the grid. | |
| int | yCoord |
| Holds the x-coordinate in the grid. | |
| std::string | textureName |
| Holds the name of the Texture used. | |
| bool | isVisible |
| Holds the Information if the Field is visable. | |
| bool | isSettleRange |
| Holds the Information if the fiel is settlerange. | |
Static Public Attributes | |
| static int | s_selectedFieldID = -1 |
| Holds the id of the selected Field. | |
| static Object * | shadowTexture = 0 |
| Holds the shadow texture. | |
It can contain a unit.
Definition at line 30 of file Field.h.
| Field::Field | ( | ) |
Standard constructor.
Definition at line 30 of file Field.cpp.
References isSettleRange, isVisible, Object::size, and unit.
Renders the Object on the field at the given position.
| p_pos | Position on the screen where the object should be rendered. | |
| p_level | Pointer to the level instance. | |
| p_deltasize | Size multiplier. Default = 1.0 |
Definition at line 54 of file Field.cpp.
References isVisible, Unit::render(), and unit.
Referenced by Interface::render().
Here is the call graph for this function:

| int Field::select | ( | std::string | p_filename | ) |
Selects the Texture to aply corresponding to energy value.
| p_filename | Filename for the texture to load. |
Definition at line 66 of file Field.cpp.
References energy, isSettleRange, Texture::loadAndBind(), and textureName.
Referenced by Unit::leechEnergy().
Here is the call graph for this function:

| int Field::render | ( | Vector3d | p_pos, | |
| double | p_deltasize = 1.0 | |||
| ) | [virtual] |
Renders the texture.
| p_pos | Position on the screen where the object should be rendered. | |
| p_deltasize | Size multiplier. Default = 1.0 |
Reimplemented from Object.
Definition at line 43 of file Field.cpp.
References isVisible, Object::render(), Texture::render(), and shadowTexture.
Referenced by Interface::render().
Here is the call graph for this function:

| Field * Field::getField | ( | ) | [virtual] |
Holds the Object on the Field.
Definition at line 80 of file Field.h.
Referenced by EventDeleteUnit::compute(), EventComputeUnit::compute(), Field(), Unit::generate(), renderChild(), FunctionHandler::select(), FunctionHandler::selectBonus(), FunctionHandler::setSpawnDestination(), FunctionHandler::settle(), FunctionHandler::standardAction(), and FunctionHandler::terminate().
| int Field::energy |
Holds the energy of the field.
Definition at line 85 of file Field.h.
Referenced by Unit::compute(), Unit::leechEnergy(), select(), and FunctionHandler::settle().
| int Field::xCoord |
Holds the x-coordinate in the grid.
Definition at line 90 of file Field.h.
Referenced by FunctionHandler::isConnected(), and FunctionHandler::standardAction().
| int Field::yCoord |
Holds the x-coordinate in the grid.
Definition at line 95 of file Field.h.
Referenced by FunctionHandler::isConnected(), and FunctionHandler::standardAction().
int Field::s_selectedFieldID = -1 [static] |
Holds the id of the selected Field.
Definition at line 100 of file Field.h.
Referenced by Interface::render(), FunctionHandler::select(), FunctionHandler::selectBonus(), FunctionHandler::setSpawnDestination(), FunctionHandler::settle(), FunctionHandler::standardAction(), and FunctionHandler::terminate().
| std::string Field::textureName |
Holds the name of the Texture used.
Definition at line 105 of file Field.h.
Referenced by Unit::leechEnergy(), and select().
| bool Field::isVisible |
| bool Field::isSettleRange |
Holds the Information if the fiel is settlerange.
Definition at line 115 of file Field.h.
Referenced by Field(), select(), and FunctionHandler::settle().
Object * Field::shadowTexture = 0 [static] |
Holds the shadow texture.
Definition at line 120 of file Field.h.
Referenced by Level::load(), and render().
1.5.2