VisuPlayer.hh

00001 /*
00002 ** TowBowlTactics, a turn-based strategy football game.
00003 **
00004 ** Copyright (C) 2006-2010 The TBT Team.
00005 **
00006 ** This program is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU General Public License
00008 ** as published by the Free Software Foundation; either version 2
00009 ** of the License, or (at your option) any later version.
00010 **
00011 ** The complete GNU General Public Licence Notice can be found as the
00012 ** `NOTICE' file in the root directory.
00013 **
00014 ** The TBT Team consists of people listed in the `AUTHORS' file.
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 /* !VISUPLAYER_HH_ */
Generated on Mon Apr 5 21:17:14 2010 for Stechec/TBT by  doxygen 1.6.3