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 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