VisuPlayer.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VISUPLAYER_HH_
00018 # define VISUPLAYER_HH_
00019
00020 # include "ActionPopup.hh"
00021 # include "Sprite.hh"
00022
00023 class Api;
00024 class CPlayer;
00025
00026 BEGIN_NS(sdlvisu);
00027
00028 class Game;
00029 class ActionPopup;
00030
00038 class VisuPlayer : public Sprite
00039 {
00040 public:
00041 VisuPlayer(Game& game, ActionPopup* act_popup, const CPlayer* p);
00042 virtual ~VisuPlayer();
00043
00045 const CPlayer* getPlayer() const;
00046
00047 void unselect();
00048
00050 void beginTurn();
00051
00053 void finishTurn();
00054
00058 void beginAction(enum eAction action);
00059
00063 void onEventAction(enum eAction action);
00064
00066 void autoSelectEffort();
00067
00069 enum eEffort getSelectedEffort() const;
00070
00074 void selectEffort(enum eEffort effort);
00075
00077 void updateStatus();
00078
00080 virtual void enable();
00082 virtual void disable();
00084 virtual void setPos(const Point& pos);
00085
00086 virtual void update();
00087
00088 private:
00089 void select();
00090
00092 void targetEffort(enum eEffort effort);
00093
00095 void finishAction();
00096
00097 Api* api_;
00098 Game& game_;
00099 ActionPopup* action_popup_;
00100 const CPlayer* p_;
00101
00102 bool has_focus_;
00103 bool is_selected_;
00104 bool has_played_;
00105
00106 Sprite availability_circle_;
00107 Sprite selection_circle_;
00108 Sprite player_num_;
00109 Sprite status_;
00110
00111 enum eEffort target_effort_;
00112
00113 bool path_drawn_;
00114 bool block_drawn_;
00115 bool throw_drawn_;
00116 };
00117
00118 END_NS(sdlvisu);
00119
00120 #endif