|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--fi.utu.cs.physics.Particle
|
+--fi.utu.cs.physics.Body
|
+--fi.utu.cs.physics.OrientedBody
|
+--fi.utu.cs.hockey.Player
A player.
| Field Summary | |
static double |
RADIUS
Radius of a player in meters. |
static double |
REACHABILITY
Reachability of a player in meters. |
| Constructor Summary | |
Player(Point2 p)
Creates a player at location p. |
|
| Method Summary | |
void |
advance(double dt)
Advances the time dt seconds and updates the position,
velocity, and rotation of the player accordingly. |
void |
brake(double p)
Brakes or dashes the player backward with the proportional power of p. |
boolean |
canReach(Puck p)
Returns true, if player can reach the puck
p. |
java.awt.Color |
color()
Returns a Color object that is used for drawing
the outline. |
void |
dash(double p)
Dashes the player forward with the proportional power of p. |
java.awt.Color |
getHelmetColor()
Returns the player's helmet color. |
java.awt.Color |
getJerseyColor()
Returns the player's jersey color. |
java.lang.String |
getName()
Returns the player's name. |
int |
getNumber()
Returns the player's number. |
int |
getPlayPosition()
Returns the player's position in the team. |
void |
head(double a)
Turns the player's orientation a
radians clockwise. |
boolean |
isDrawn()
Returns a boolean value indicating whether the outline of the shape is drawn or not. |
boolean |
isFilled()
Returns a boolean value indicating whether the shape is filled or not. |
boolean |
isHome()
Returns true if the player belongs to the home team. |
ShapeIterator |
iterator()
|
java.awt.Paint |
paint()
Returns a Paint object that is used for filling
the shape. |
void |
setColors(java.awt.Color h,
java.awt.Color j)
Sets the player's helmet color to h and
jersey color to j. |
void |
setName(java.lang.String s)
Sets the player's name to s. |
void |
setNumber(int n)
Sets the player's number to n. |
java.awt.Shape |
shape()
Returns a Shape object that defines the appearance
of the object. |
java.awt.Stroke |
stroke()
Returns a Stroke object that is used for drawing
the outline. |
java.lang.String |
toString()
Returns a string that contains the values of the attributes. |
| Methods inherited from class fi.utu.cs.physics.OrientedBody |
futureVelocity, getNormalFriction, getOrientation, getTangentFriction, setNormalFriction, setOrientation, setTangentFriction |
| Methods inherited from class fi.utu.cs.physics.Body |
elasticCollision, futurePosition, getAcceleration, getMass, getPosition, getRadius, getVelocity, inelasticCollision, isColliding, isOverlapping, setAcceleration, setAcceleration, setMass, setPosition, setPosition, setRadius, setVelocity, setVelocity |
| Methods inherited from class fi.utu.cs.physics.Particle |
addCollisionNotification, clearCollisionNotifications, getOwner, isCollisionNotified, isCollisionNotified, isCorporeal, removeCollisionNotification, setCorporeal, setEthereal, setOwner |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final double RADIUS
public static final double REACHABILITY
| Constructor Detail |
public Player(Point2 p)
p.
| Method Detail |
public java.lang.String getName()
public void setName(java.lang.String s)
s.
public int getNumber()
public void setNumber(int n)
n.
public int getPlayPosition()
public boolean isHome()
true if the player belongs to the home team.
public java.awt.Color getHelmetColor()
public java.awt.Color getJerseyColor()
public void setColors(java.awt.Color h,
java.awt.Color j)
h and
jersey color to j.
public void dash(double p)
p.
public void brake(double p)
p.
public void head(double a)
a
radians clockwise.
public boolean canReach(Puck p)
true, if player can reach the puck
p.
public void advance(double dt)
dt seconds and updates the position,
velocity, and rotation of the player accordingly.
advance in class BodyBody.futurePosition(double),
Body.futureVelocity(double)public java.awt.Shape shape()
ShapableShape object that defines the appearance
of the object.
shape in interface ShapableShapepublic boolean isDrawn()
Shapable
isDrawn in interface ShapableShapable.stroke(),
Shapable.color()public java.awt.Stroke stroke()
ShapableStroke object that is used for drawing
the outline.
stroke in interface ShapableShapable.isDrawn(),
Strokepublic java.awt.Color color()
ShapableColor object that is used for drawing
the outline.
color in interface ShapableShapable.isDrawn(),
Colorpublic boolean isFilled()
Shapable
isFilled in interface ShapableShapable.paint()public java.awt.Paint paint()
ShapablePaint object that is used for filling
the shape.
paint in interface ShapableShapable.isFilled(),
Paintpublic ShapeIterator iterator()
iterator in interface MultiShapablepublic java.lang.String toString()
OrientedBody
toString in class OrientedBody
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||