All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.gatech.cc.is.simulation.GolfBallSim

java.lang.Object
   |
   +----EDU.gatech.cc.is.simulation.AttractorSim
           |
           +----EDU.gatech.cc.is.simulation.GolfBallSim

public class GolfBallSim
extends AttractorSim
implements SimulatedObject, SocRef
A golfball for RoboCup Soccer. Introduction
GolfBallSim implements a golf ball for RoboCup soccer simulations. The ball is also the scorekeeper and the referee; after all who would know better whether a scoring event occured?

A "shot clock" keeps track of how long since a scoring event occured. If it times-out, the ball is reset to the center of the field.

Copyright (c)1997 Georgia Tech Research Corporation

Version:
$Revision: 1.3 $
Author:
Tucker Balch

Variable Index

 o DEBUG

Constructor Index

 o GolfBallSim()
Instantiate a golf ball.

Method Index

 o draw(Graphics, int, int, double, double, double, double)
Draw the golf ball and display score and shotclock.
 o eastJustScored()
True if it is east just scored.
 o eastKickOff()
True if it is east's turn to kick off.
 o playBall()
True if the game is underway.
 o push(Vec2, Vec2)
Handle a push.
 o takeStep(long, SimulatedObject[])
Take a simulated step;
 o westJustScored()
True if it is west just scored.
 o westKickOff()
True if it is west's turn to kick off.

Variables

 o DEBUG
 public static final boolean DEBUG

Constructors

 o GolfBallSim
 public GolfBallSim()
Instantiate a golf ball.

Methods

 o takeStep
 public void takeStep(long time_increment,
                      SimulatedObject all_objs[])
Take a simulated step;

Overrides:
takeStep in class AttractorSim
 o push
 public void push(Vec2 d,
                  Vec2 v)
Handle a push. This is how to kick or push the ball.

Overrides:
push in class AttractorSim
 o draw
 public void draw(Graphics g,
                  int w,
                  int h,
                  double t,
                  double b,
                  double l,
                  double r)
Draw the golf ball and display score and shotclock.

Overrides:
draw in class AttractorSim
 o playBall
 public boolean playBall()
True if the game is underway. If false, the soccer robots should reset their positions on the field according to whether they kick off or not.

Returns:
true if game is underway.
 o eastKickOff
 public boolean eastKickOff()
True if it is east's turn to kick off.

Returns:
true if it is east's turn to kick off.
 o westKickOff
 public boolean westKickOff()
True if it is west's turn to kick off. This occurs at the begining of the game, and after east scores.

Returns:
true if it is west's turn to kick off.
 o westJustScored
 public boolean westJustScored()
True if it is west just scored.

Returns:
true if west just scored.
 o eastJustScored
 public boolean eastJustScored()
True if it is east just scored.

Returns:
true if east just scored.

All Packages  Class Hierarchy  This Package  Previous  Next  Index