fi.utu.cs.hockey
Class Puck

java.lang.Object
  |
  +--fi.utu.cs.physics.Particle
        |
        +--fi.utu.cs.physics.Body
              |
              +--fi.utu.cs.physics.FrictionalBody
                    |
                    +--fi.utu.cs.hockey.Puck
All Implemented Interfaces:
FaceOff, MultiShapable, Shapable

public class Puck
extends FrictionalBody
implements MultiShapable, FaceOff

A puck.


Field Summary
static double DIAMETER
          Diameter of the puck.
 
Fields inherited from interface fi.utu.cs.hockey.rink.FaceOff
CENTER_SPOT, HOME_ENDZONE_LEFT, HOME_ENDZONE_RIGHT, HOME_NEUTRAL_ZONE_LEFT, HOME_NEUTRAL_ZONE_RIGHT, VISITOR_ENDZONE_LEFT, VISITOR_ENDZONE_RIGHT, VISITOR_NEUTRAL_ZONE_LEFT, VISITOR_NEUTRAL_ZONE_RIGHT
 
Constructor Summary
Puck(Point2 p)
          Creates a puck at position p.
 
Method Summary
 java.awt.Color color()
          Returns a Color object that is used for drawing the outline.
 void faceoff(int s)
          Drops the puck at faceoff spot s.
 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.
 ShapeIterator iterator()
           
 java.awt.Paint paint()
          Returns a Paint object that is used for filling the shape.
 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.FrictionalBody
futureVelocity, getFriction, setFriction
 
Methods inherited from class fi.utu.cs.physics.Body
advance, 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

DIAMETER

public static final double DIAMETER
Diameter of the puck.

See Also:
Constant Field Values
Constructor Detail

Puck

public Puck(Point2 p)
Creates a puck at position p.

Method Detail

faceoff

public void faceoff(int s)
Drops the puck at faceoff spot s.

See Also:
FaceOff

shape

public java.awt.Shape shape()
Description copied from interface: Shapable
Returns a Shape object that defines the appearance of the object.

Specified by:
shape in interface Shapable
See Also:
Shape

isDrawn

public boolean isDrawn()
Description copied from interface: Shapable
Returns a boolean value indicating whether the outline of the shape is drawn or not.

Specified by:
isDrawn in interface Shapable
See Also:
Shapable.stroke(), Shapable.color()

stroke

public java.awt.Stroke stroke()
Description copied from interface: Shapable
Returns a Stroke object that is used for drawing the outline.

Specified by:
stroke in interface Shapable
See Also:
Shapable.isDrawn(), Stroke

color

public java.awt.Color color()
Description copied from interface: Shapable
Returns a Color object that is used for drawing the outline.

Specified by:
color in interface Shapable
See Also:
Shapable.isDrawn(), Color

isFilled

public boolean isFilled()
Description copied from interface: Shapable
Returns a boolean value indicating whether the shape is filled or not.

Specified by:
isFilled in interface Shapable
See Also:
Shapable.paint()

paint

public java.awt.Paint paint()
Description copied from interface: Shapable
Returns a Paint object that is used for filling the shape.

Specified by:
paint in interface Shapable
See Also:
Shapable.isFilled(), Paint

iterator

public ShapeIterator iterator()
Specified by:
iterator in interface MultiShapable

toString

public java.lang.String toString()
Description copied from class: FrictionalBody
Returns a string that contains the values of the attributes.

Overrides:
toString in class FrictionalBody