Api.hh

00001 /*
00002 ** TowBowlTactics, an adaptation of the tabletop game Blood Bowl.
00003 ** 
00004 ** Copyright (C) 2006 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 API_HH_
00018 # define API_HH_
00019 
00020 # include "BaseApi.hh"
00021 # include "CRules.hh"
00022 
00034 class Api : public BaseApi<CRules>
00035 {
00036 public:
00037   Api(CRules* rules);
00038   ~Api();
00039  
00046 
00050   int                   turn() const;
00051 
00054   int                   half() const;
00055  
00058   int                   myTeamId() const;
00061   Point                 ball() const;
00064   const CPlayer*        getBallOwner() const;
00065 
00069   const char*           gameStateString() const;
00070 
00074   int                   teamId(const Point& pos);
00075   
00082   void                  selectTeam(int team_id);
00085   const CTeam*          getTeam() const;
00086 
00092   int                   selectPlayer(int player_id);
00093   
00097   int                   selectSkilledPlayer(int player_id);
00098   
00102   int                   playerId(const Point& pos);
00103 
00106   const CPlayer*        getPlayer() const;
00110   const CPlayer*        getPlayer(int player_id);
00115   const CPlayer*        getPlayer(const Point& pos);
00116   
00119   int                   declarationPossibleNumber();
00120 
00125   int                   declarationPossible(int index) const;
00126 
00129   int                   actionPossibleNumber();
00130 
00134   int                   actionPossible(int index) const;
00135 
00141   int                   moveLength(const Point& to);
00142 
00148   int                   moveDifficulty(int step);
00149 
00155   Point                 movePath(int step);
00156 
00161   int                   movePossible(const Point& to);
00162 
00165   int           remainingTime() const;
00166   
00169   const Weather*        getWeather() const;
00170   
00172 
00173 
00185 
00187   void          doEndTurn();
00188 
00190   void          doMoveTurnMarker();
00191 
00193   void          doAskIllegalProcedure();
00194 
00199   int           doChooseKickoff(bool kickoff);
00200 
00206   int           doPlacePlayer(const Point& pos);
00207 
00209   int           doEndPlacement();
00210 
00213   int           doPlaceBall(const Point& pos);
00214 
00218   int           doGiveBall(int p);
00219 
00223   int           doReroll(bool reroll);
00224 
00229   int           doUseSkill(enum eSkill skill, bool useIt);
00230 
00233   int           doDeclare(enum eDeclaredAction action);
00234 
00239   int           doChooseBlockDice(int n);
00240 
00245   int           doBlockPush(int n);
00246 
00250   int           doFollow(bool follow);
00251 
00254   int           doStandUpPlayer();
00255 
00258   int           doMovePlayer(const Point& to);
00259 
00263   int           doBlockPlayer(int def_p);
00264 
00268   int           doPassPlayer(const Point& to);
00269 
00272   void          doCheatDice(int roll);
00273 
00276   void          sendChatMessage(const std::string& msg);
00277 
00279 
00280 
00281 private:
00282   CTeam*                selected_team_;
00283   CPlayer*              selected_player_;
00284   CPlayer*              skilled_player_;
00285   const PosList*        player_path_;
00286   bool                  possible_declarations_[DCL_LAST];
00287   bool                  possible_actions_[ACT_LAST];
00288 };
00289 
00290 # include "Api.hxx"
00291 
00292 #endif /* !API_HH_ */

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