SBall.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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