#include <FunctionHandler.h>
Public Member Functions | |
FunctionHandler () | |
Standard constructor. | |
~FunctionHandler () | |
Standard destructor. | |
Static Public Member Functions | |
static std::string | quit (std::vector< std::string > &p_params, Level *level) |
Cleans up the game and quits. | |
static std::string | zoomIn (std::vector< std::string > &p_params, Level *level) |
Places the camera closer to the grid. | |
static std::string | zoomOut (std::vector< std::string > &p_params, Level *level) |
Places the camera further away from the grid. | |
static std::string | scrollUp (std::vector< std::string > &p_params, Level *level) |
Scrolls the grid up. | |
static std::string | scrollDown (std::vector< std::string > &p_params, Level *level) |
Scrolls the grid down. | |
static std::string | scrollLeft (std::vector< std::string > &p_params, Level *level) |
Scrolls the grid left. | |
static std::string | scrollRight (std::vector< std::string > &p_params, Level *level) |
Scrolls the grid down. | |
static std::string | select (std::vector< std::string > &p_params, Level *level) |
Operates on the object that has been clicked on. | |
static std::string | grabScreen (std::vector< std::string > &p_params, Level *level) |
On right click grab the screen for mouse scrolling. | |
static std::string | releaseScreen (std::vector< std::string > &p_params, Level *level) |
On releasing right mouse button release the screen for mouse scrolling. | |
static std::string | scroll (std::vector< std::string > &p_params, Level *level) |
While grabbed the screen will be moved corresponding to mouse movement. | |
static std::string | standardAction (std::vector< std::string > &p_params, Level *level) |
Computes the standard action with the selected unit depending on the target. | |
static std::string | settle (std::vector< std::string > &p_params, Level *level) |
Lets the Unit on the current field settle. | |
static std::string | terminate (std::vector< std::string > &p_params, Level *level) |
Lets the Unit on the current field kill and mutate. | |
static std::string | setSpawnDestination (std::vector< std::string > &p_params, Level *level) |
Sets the spawn point for the selected and settled unit. | |
static std::string | selectBonus (std::vector< std::string > &p_params, Level *level) |
Selects the Bous for the selected Unit. | |
Static Protected Member Functions | |
static int | isConnected (Field *origin, Field *destination) |
Checks if two field are connected to each other. |
Definition at line 37 of file FunctionHandler.h.
FunctionHandler::FunctionHandler | ( | ) |
FunctionHandler::~FunctionHandler | ( | ) |
std::string FunctionHandler::quit | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Cleans up the game and quits.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 46 of file FunctionHandler.cpp.
Referenced by Level::Level().
std::string FunctionHandler::zoomIn | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Places the camera closer to the grid.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 52 of file FunctionHandler.cpp.
References Level::position, and Vector3d::z.
Referenced by Level::Level().
std::string FunctionHandler::zoomOut | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Places the camera further away from the grid.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 61 of file FunctionHandler.cpp.
References Level::position, and Vector3d::z.
Referenced by Level::Level().
std::string FunctionHandler::scrollUp | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Scrolls the grid up.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 70 of file FunctionHandler.cpp.
References Level::position, and Vector3d::y.
Referenced by Level::Level().
std::string FunctionHandler::scrollDown | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Scrolls the grid down.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 76 of file FunctionHandler.cpp.
References Level::position, and Vector3d::y.
Referenced by Level::Level().
std::string FunctionHandler::scrollLeft | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Scrolls the grid left.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 82 of file FunctionHandler.cpp.
References Level::position, and Vector3d::x.
Referenced by Level::Level().
std::string FunctionHandler::scrollRight | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Scrolls the grid down.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 88 of file FunctionHandler.cpp.
References Level::position, and Vector3d::x.
Referenced by Level::Level().
std::string FunctionHandler::select | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Operates on the object that has been clicked on.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 94 of file FunctionHandler.cpp.
References Level::bindings, Unit::generates, Texture::get(), Texture::getButton(), Texture::getField(), Texture::id, GLInterface::inputMessages, Unit::isSettled, Button::label, Level::pick(), Field::s_selectedFieldID, Unit::s_selectedID, selectBonus(), and Field::unit.
Referenced by Level::Level().
Here is the call graph for this function:
std::string FunctionHandler::grabScreen | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
On right click grab the screen for mouse scrolling.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 154 of file FunctionHandler.cpp.
References Level::bindings, Level::currentCommands, Window::mousePos, Level::mousePos, and GLInterface::window.
Referenced by Level::Level().
std::string FunctionHandler::releaseScreen | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
On releasing right mouse button release the screen for mouse scrolling.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 165 of file FunctionHandler.cpp.
References Level::bindings, and Level::currentCommands.
Referenced by Level::Level().
std::string FunctionHandler::scroll | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
While grabbed the screen will be moved corresponding to mouse movement.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 173 of file FunctionHandler.cpp.
References Window::height, Window::mousePos, Level::mousePos, Level::position, Window::width, GLInterface::window, Vector3i::x, Vector3d::x, Vector3i::y, Vector3d::y, and Vector3d::z.
Referenced by Level::Level().
std::string FunctionHandler::standardAction | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Computes the standard action with the selected unit depending on the target.
A not settled unit will settle, if itself has been right-clicked; it will move to the neighbor field if that has been rightclicked; it will attack the oponent unit if that has been right-clicked.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 186 of file FunctionHandler.cpp.
References Unit::absorb_cooldown, Unit::absorb_cooldown_core, Unit::absorb_cost, Level::effects, Player::energy, Level::eventList, Texture::get(), Unit::getCombatValue(), Texture::getField(), Texture::id, Unit::isBlocked, isConnected(), Texture::loadAndBind(), Unit::move_cooldown, Unit::move_cost, Level::pick(), Unit::player, Field::s_selectedFieldID, Texture::sequenceCount, settle(), Field::unit, Field::xCoord, and Field::yCoord.
Referenced by Level::Level(), and setSpawnDestination().
Here is the call graph for this function:
std::string FunctionHandler::settle | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Lets the Unit on the current field settle.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 315 of file FunctionHandler.cpp.
References Level::bindings, Field::energy, Level::eventList, Unit::generates, Texture::get(), Texture::getField(), Unit::isBlocked, Field::isSettleRange, Field::s_selectedFieldID, Unit::settle(), Unit::settle_cooldown, and Field::unit.
Referenced by Level::Level(), and standardAction().
Here is the call graph for this function:
std::string FunctionHandler::terminate | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Lets the Unit on the current field kill and mutate.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 346 of file FunctionHandler.cpp.
References Texture::get(), Texture::getField(), Unit::mutate(), Unit::mutates, Field::s_selectedFieldID, and Field::unit.
Here is the call graph for this function:
std::string FunctionHandler::setSpawnDestination | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Sets the spawn point for the selected and settled unit.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 370 of file FunctionHandler.cpp.
References Level::eventList, Texture::get(), Texture::getField(), isConnected(), Unit::isSettled, Level::pick(), Unit::player, Field::s_selectedFieldID, Unit::s_selectedID, Unit::settledCombatValue, Unit::spawnDestination, Unit::spawnDestinationField, standardAction(), and Field::unit.
Referenced by Level::Level().
Here is the call graph for this function:
std::string FunctionHandler::selectBonus | ( | std::vector< std::string > & | p_params, | |
Level * | level | |||
) | [static] |
Selects the Bous for the selected Unit.
p_params | List of paramters for the function. | |
level | Pointer to the game itself. |
Definition at line 435 of file FunctionHandler.cpp.
References Unit::bonus, Player::energy, Texture::get(), Texture::getButton(), Texture::getField(), Unit::isSettled, Unit::movingCombatBonus, Level::pick(), Unit::player, Field::s_selectedFieldID, Unit::settledCombatBonus, Field::unit, and Button::val.
Referenced by Level::Level(), and select().
Here is the call graph for this function:
Checks if two field are connected to each other.
origin | The first field to test. | |
destination | The second field to test. |
Definition at line 473 of file FunctionHandler.cpp.
References Field::xCoord, and Field::yCoord.
Referenced by setSpawnDestination(), and standardAction().