OpStack.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 OPSTACK_HH_
00018 # define OPSTACK_HH_
00019 
00020 # include "Constants.hh"
00021 
00022 class SPlayer;
00023 class SRules;
00024 
00034 class OpStack
00035 {
00036 public:
00037   OpStack(SRules* r);
00038   virtual ~OpStack();
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, Coordinates aim);
00057   void putPickUpRoll(SPlayer* p, bool success);
00058   void putPushResolution(SPlayer* p);
00059   void putStandUpRoll(SPlayer* p, bool success);
00060   void putTameRoll(SPlayer* p, bool success);
00061   void putThrowRoll(SPlayer* p, int success);
00062 
00064   void process(bool reroll = false, int choice = -1);
00065 
00066 private:
00067   enum eOperation {
00068     OP_BALL,          
00069     OP_BLOCKBDD,      
00070     OP_BLOCKBDA,      
00071     OP_BLOCKDICE,     
00072     OP_BLOCKFOLLOW,   
00073     OP_BLOCKPUSH,     
00074     OP_BLOCKSTUMBLE,  
00075     OP_MOVE,          
00076     OP_PUSH,          
00077     OP_ROLL,          
00078   };
00079   struct Operation {
00080     enum eOperation type;
00081     enum eRoll roll_type;
00082     SPlayer* player;
00083     int success;
00084     int modifier;
00085     int next_mod;
00086     Coordinates aim_coordinates;
00087     /* Still unused:
00088     enum eSkill skill;
00089     enum eStatus status;
00090     SPlayer* target_player;
00091     */
00092   };
00093   typedef std::vector<Operation> OperationList;
00094 
00095   void put(Operation op);
00096 
00097   SRules* r_;
00098   OperationList opv_;
00099 };
00100 
00101 #endif /* !OPSTACK_HH_ */
Generated on Mon Apr 5 21:17:12 2010 for Stechec/TBT by  doxygen 1.6.3