Player class for visu.Player caracteristics are not stored in this class, they are fetched from Api. More...
#include <VisuPlayer.hh>

Public Member Functions | |
| VisuPlayer (Game &game, ActionPopup *act_popup, const CPlayer *p) | |
| const CPlayer * | getPlayer () const |
| Get CPlayer associated with. | |
| void | unselect () |
| void | beginTurn () |
| Called at each new turn. Reset some variables. | |
| void | finishTurn () |
| Called at each end turn. Reset some variables. | |
| void | beginAction (enum eAction action) |
| Begin an action. | |
| void | onEventAction (enum eAction action) |
| Handles action event. | |
| void | autoSelectEffort () |
| Auto-select an effort, if possible. | |
| enum eEffort | getSelectedEffort () const |
| Get selected action. | |
| void | selectEffort (enum eEffort effort) |
| Select an effort. | |
| void | updateStatus () |
| Update status/ball mini-icon. | |
| virtual void | enable () |
| Enable player number, status, etc. at the same time. | |
| virtual void | disable () |
| Disable player number, status, etc. at the same time. | |
| virtual void | setPos (const Point &pos) |
| Set position of player number, status, etc. at the same time. | |
| virtual void | update () |
| Method called each frame, to perfom user custom code. | |
Player class for visu.
Player caracteristics are not stored in this class, they are fetched from Api.
| void sdlvisu::VisuPlayer::beginAction | ( | enum eAction | action | ) |
Begin an action.
| action | Action selected. |
References Api::doBeginAction(), Api::selectPlayer(), Api::selectTeam(), Player::stringify(), sdlvisu::Game::unsetState(), and sdlvisu::VGS_MAKEEFFORT.
Referenced by sdlvisu::ActionPopup::update().
| void sdlvisu::VisuPlayer::onEventAction | ( | enum eAction | action | ) |
Handles action event.
| action | Action which begins. |
References sdlvisu::Map::centerViewTo(), Surface::getPos(), sdlvisu::Panel::setDefaultPlayerInfo(), Sprite::setFrame(), and Surface::show().
| void sdlvisu::VisuPlayer::selectEffort | ( | enum eEffort | effort | ) |
Select an effort.
| effort | Effort to select. |
References sdlvisu::Game::setState(), Player::stringify(), sdlvisu::Game::unsetState(), and sdlvisu::VGS_MAKEEFFORT.
Referenced by autoSelectEffort(), and sdlvisu::ActionPopup::update().
| void sdlvisu::VisuPlayer::update | ( | ) | [virtual] |
Method called each frame, to perfom user custom code.
You should override it.
Since a parent is assigned to the surface (and this parent is itself attached by other means to the root screen), this method is called at each frame. It is not called if this surface or one of its parent is disabled. In this method you can do what you want with your object, like processing input, updating other programs attributes, changing surface property, ...
Reimplemented from Sprite.
References Sprite::anim(), Input::button_pressed_, Api::canMakeRequest(), sdlvisu::Map::clearBlock(), sdlvisu::Map::clearPath(), sdlvisu::Map::clearThrow(), Api::doPlacePlayer(), sdlvisu::Map::drawBlock(), sdlvisu::Map::drawPath(), sdlvisu::Map::drawThrow(), Player::getAction(), Api::getActiveTeamId(), Api::getPlayer(), Surface::getScreenRect(), getSelectedEffort(), sdlvisu::Map::getSelectedPlayer(), BaseApi< T >::getState(), Player::getStatus(), GS_INITKICKOFF, GS_TURN, Player::hasPlayed(), Coordinates::isNear(), sdlvisu::Game::isStateSet(), Input::mouse_, sdlvisu::Map::mouseInsideField(), sdlvisu::Map::mouseToSquare(), Api::mustMakeChoice(), Api::myTeamId(), Api::selectPlayer(), Api::selectTeam(), sdlvisu::Panel::setPlayerInfo(), sdlvisu::ActionPopup::show(), Sprite::stopAnim(), sdlvisu::Panel::unsetDefaultPlayerInfo(), sdlvisu::Panel::unsetPlayerInfo(), sdlvisu::Game::unsetState(), sdlvisu::VGS_INPLAY, sdlvisu::VGS_MAKEEFFORT, and sdlvisu::VGS_SHOWDLGBOX.
Referenced by sdlvisu::ActionPopup::update().
1.6.3