SActionHandler.hh

00001 /*
00002 ** TowBowlTactics, an adaptation of the tabletop game Blood Bowl.
00003 ** 
00004 ** Copyright (C) 2006, 2007 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 SACTIONHANDLER_HH_
00018 # define SACTIONHANDLER_HH_
00019 
00020 # include "Constants.hh"
00021 
00022 class SPlayer;
00023 class SRules;
00024 
00034 class SActionHandler
00035 {
00036 public:
00037   SActionHandler(SRules* r);
00038   virtual ~SActionHandler();
00039 
00040   bool isEmpty() const;
00041   SPlayer* getPlayer() const;
00042   enum eRoll getRollType() const;
00043 
00045   void putArmourRoll(SPlayer* p, int av_mod = 0, int inj_mod = 0);
00046   void putBallBounce();
00047   void putBlockBothDownDefender(SPlayer* p);
00048   void putBlockBothDownAttacker(SPlayer* p);
00049   void putBlockDefenderStumble(SPlayer* p);
00050   void putBlockDiceChoice(SPlayer* p);
00051   void putBlockFollowChoice(SPlayer* p);
00052   void putBlockPushChoice(SPlayer* p);
00053   void putBlockRoll(SPlayer* p);
00054   void putCatchBallRoll(SPlayer* p, bool success);
00055   void putDodgeRoll(SPlayer* p, bool success);
00056   void putMove(SPlayer* p, Position aim);
00057   void putPickUpRoll(SPlayer* p, bool success);
00058   void putPushResolution(SPlayer* p);
00059   void putStandUpRoll(SPlayer* p, bool success);
00060   void putThrowRoll(SPlayer* p, int success);
00061 
00063   void process(bool reroll = false, int choice = -1);
00064 
00065 private:
00066   enum eElementaryAction {
00067     EA_BALL,          
00068     EA_BLOCKBDD,      
00069     EA_BLOCKBDA,      
00070     EA_BLOCKDICE,     
00071     EA_BLOCKFOLLOW,   
00072     EA_BLOCKPUSH,     
00073     EA_BLOCKSTUMBLE,  
00074     EA_MOVE,          
00075     EA_PUSH,          
00076     EA_ROLL,          
00077   };
00078   struct ElementaryAction {
00079     enum eElementaryAction type;
00080     enum eRoll roll_type;
00081     SPlayer* player;
00082     int success;
00083     int modifier;
00084     int next_mod;
00085     Position aim_position;
00086     /* Still unused:
00087     enum eSkill skill;
00088     enum eStatus status;
00089     SPlayer* target_player;
00090     */
00091   };
00092   typedef std::vector<ElementaryAction> ElementaryActionList;
00093 
00094   void put(ElementaryAction ea);
00095 
00096   SRules* r_;
00097   ElementaryActionList eal_;
00098 };
00099 
00100 #endif /* !SACTIONHANDLER_HH_ */

Generated on Sat Jun 23 16:07:24 2007 for Stechec/TBT by  doxygen 1.4.7