SBall.hh

00001 /*
00002 ** TowBowlTactics, a turn-based strategy football game.
00003 ** 
00004 ** Copyright (C) 2006-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 SBALL_H_
00018 # define SBALL_H_
00019 
00020 # include "Ball.hh"
00021 
00022 class SMatch;
00023 class SPlayer;
00024 class SRules;
00025 
00035 class SBall : public Ball<SPlayer>
00036 {
00037 public:
00038   SBall(SRules* r, SMatch* m);
00039 
00045   void setCoordinates(const Coordinates& coord, bool advertise_client = true);
00046 
00048   void setOwner(SPlayer* p);
00049 
00052   void removeFromField();
00053 
00055   void bounce(int nb = 1);
00060   void scatter(int nb);
00061 
00063   void throwIn();
00064   void setThrown();
00065   bool hasBeenThrown() const;
00066 
00067   void resetTurn();
00068 
00071   void sendCoordinates(Coordinates old_coord) const;
00072 
00073 private:
00077   void afterBounce(const Coordinates& delta, int amplitude);
00078 
00079   void msgPlaceBall(const MsgBallCoord* m);
00080   void msgGiveBall(const MsgBallOwner* m);
00081   bool invalidKickoffDestination(const Coordinates& coord) const;
00082   void touchback();
00083   
00084   SRules* r_;
00085   SMatch* m_;
00086   bool thrown_;
00087 };
00088 
00089 #endif /* !SBALL_H_ */
Generated on Mon Apr 5 21:17:13 2010 for Stechec/TBT by  doxygen 1.6.3