00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00087
00088
00089
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