interface.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 INTERFACE_HH_
00018 # define INTERFACE_HH_
00019 
00020 # include "tools.hh"
00021 # include "ClientCx.hh"
00022 # include "Api.hh"
00023 # include "Event.hh"
00024 # include "input.hh"
00025 
00030 class CmdLineInterface : public Event
00031 {
00032 public:
00033   CmdLineInterface(xml::XMLConfig* cfg, Api* api, ClientCx* client_cx, bool use_readline);
00034 
00035   void                hello();
00036   void                init();
00037   void                run();
00038 
00039   void                printGlobal();
00040   void                printPlayerList();
00041   void                printPlayer(int player_id, int team_id);
00042   void                printField();
00043 
00044 private:
00045   bool                checkInput();
00046 
00047   // All callbacks.
00048   virtual void          evIllegal(int team_id, int was_token);
00049   virtual void          evInitGame();
00050   virtual void          evDrawKicker(int team_id, bool is_a_question);
00051   virtual void          evNewTurn(int player_id, int cur_half, int cur_turn);
00052   virtual void          evPlaceTeam(int team_id);
00053   virtual void          evKickOff(int team_id);
00054   virtual void          evGiveBall(int team_id, int player_id);
00055   virtual void          evMoveTurnMarker();
00056   virtual void          evTouchdooown(int team_id, int player_id);
00057   virtual void          evChat(const std::string& msg);
00058   virtual void          evPlayerStatus(int team_id, int player_id, enum eStatus status);
00059   virtual void          evPlayerPos(int team_id, int player_id, const Point& pos);
00060   virtual void          evPlayerMove(int team_id, int player_id, const Point& pos);
00061   virtual void          evPlayerKnocked(int team_id, int player_id);
00062   virtual void          evResult(int team_id, int player_id, enum eRoll action_type, int result, 
00063                                  int modifier, int required, bool reroll, enum eSkill skill);
00064   virtual void          evBlock(int team_id, int player_id, int opponent_id);
00065   virtual void          evBlockResult(int team_id, int player_id, int opponent_id, 
00066                                       int nb_dice, enum eBlockDiceFace result[3],
00067                                       int choose, bool reroll);
00068   virtual void          evFollow();
00069   virtual void          evBlockPush(const Position& pos, int nb_choice, const Position choices[]);
00070   virtual void          evSkill(int team_id, int player_id, enum eSkill skill, int choice);
00071 
00072   xml::XMLConfig*       cfg_;
00073   Api*                  api_;
00074   ClientCx*             ccx_;
00075   
00076   bool                  standalone_;
00077   Input                 input_;
00078   bool                  our_turn_;
00079   bool                  paused_;
00080 };
00081 
00082 #endif /* !INTERFACE_HH_ */

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