SBall.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 SBALL_H_
00018 # define SBALL_H_
00019 
00020 # include "Ball.hh"
00021 
00022 class SPlayer;
00023 class SRules;
00024 
00034 class SBall : public Ball<SPlayer>
00035 {
00036 public:
00037   SBall(SRules* r);
00038 
00044   void setPosition(const Position& pos, bool advertise_client = true);
00045 
00047   void setOwner(SPlayer* p);
00048 
00051   void removeFromField();
00052 
00054   void bounce(int nb = 1);
00057   void scatter(int nb);
00058 
00060   void throwIn();
00061   void setThrown();
00062   bool hasBeenThrown();
00063 
00064   void resetTurn();
00065 
00066   void sendPosition();
00067 
00068 private:
00072   void afterBounce(const Position& delta, int amplitude);
00073 
00074   void msgPlaceBall(const MsgBallPos* m);
00075   void msgGiveBall(const MsgGiveBall* m);
00076   bool invalidKickoffDestination(const Position& pos) const;
00077   void touchback();
00078   
00079   SRules* r_;
00080   bool thrown_;
00081 };
00082 
00083 #endif /* !SBALL_H_ */

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