SPlayerMsg.hh

00001 /*
00002 ** TowBowlTactics, a turn-based strategy football game.
00003 ** 
00004 ** Copyright (C) 2007-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 SPLAYERMSG_HH_
00018 # define SPLAYERMSG_HH_
00019 
00020 # include "Dice.hh"
00021 # include "Player.hh"
00022 # include "SRules.hh"
00023 
00024 class SPlayer;
00025 
00036 class SPlayerMsg
00037 {
00038 public:
00039   SPlayerMsg(SRules *r);
00040   ~SPlayerMsg();
00041 
00042   void setPlayer(int team_id, int player_id, SPlayer* p);
00043 
00044   void sendAction(enum eAction action, const SPlayer* p) const;
00045   void sendMsgBlockPush(int nb_squares, const Coordinates squares[], const SPlayer* target, int chosen_square) const;
00046   void sendBlockResult(bool can_reroll, int dice_chooser_id, int nb_dices,
00047                        const enum eBlockDiceFace results[], const SPlayer* defender,
00048                        const SPlayer* attacker) const;
00049   void sendMsgKnocked(const SPlayer* p) const;
00050   void sendCoordinates(const Coordinates& old_coord, const SPlayer* p) const;
00051   void sendMaRemain(int old_ma_remain, int new_ma_remain, const SPlayer* p) const;
00052   void sendRoll(enum eRoll type, int result, int modifier, int required,
00053                 int reroll, enum eSkill skill, const SPlayer* p) const;
00054   void sendSkillQuestion(enum eSkill skill, const SPlayer* p) const;
00055   void sendSkillUsage(enum eSkill skill, const SPlayer* p) const;
00056   void sendStatus(enum eStatus old_status, enum eStatus new_status, const SPlayer* p) const;
00057   void sendTouchdooown(const SPlayer* p) const;
00058 
00059 private:
00060   SPlayer* getPlayer(int token, int team_id, int player_id);
00061 
00062   void msgBlock(const MsgBlock* m);
00063   void msgFoul(const MsgFoul* m);
00064   void msgHandOff(const MsgHandOff* m);
00065   void msgAction(const MsgAction* m);
00066   void msgMove(const MsgMove* m);
00067   void msgPass(const MsgPass* m);
00068   void msgPlayerCoord(const MsgPlayerCoord* m);
00069   void msgSkill(const MsgSkill* m);
00070   void msgStandUp(const MsgStandUp* m);
00071   
00072   SRules* r_;
00073   SPlayer* p_[2][MAX_PLAYER];
00074 };
00075 
00076 # include "SPlayerMsg.hxx"
00077 
00078 #endif /* !SPLAYERMSG_HH_ */
Generated on Mon Apr 5 21:17:13 2010 for Stechec/TBT by  doxygen 1.6.3