sdlvisu::VisuPlayer Class Reference
[2D Graphical User Inteface]

Player class for visu.Player caracteristics are not stored in this class, they are fetched from Api. More...

#include <VisuPlayer.hh>

Inheritance diagram for sdlvisu::VisuPlayer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 VisuPlayer (Game &game, ActionPopup *act_popup, const CPlayer *p)
const CPlayergetPlayer () 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.

Detailed Description

Player class for visu.

Player caracteristics are not stored in this class, they are fetched from Api.


Member Function Documentation

void sdlvisu::VisuPlayer::beginAction ( enum eAction  action  ) 

Begin an action.

Note:
Called on coach decision, via e.g. popup menu.
Parameters:
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.

Note:
Called on API event.
Parameters:
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.

Note:
Called on coach decision, via e.g. popup menu.
Parameters:
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, ...

Note:
Don't forget to call update for the base class at the end of your function , otherwise strange things will happen.

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().


The documentation for this class was generated from the following files:
Generated on Mon Apr 5 21:18:07 2010 for Stechec/TBT by  doxygen 1.6.3