components
Class Ball

java.lang.Object
  extended by java.awt.event.KeyAdapter
      extended by components.GameObject
          extended by components.Ball
All Implemented Interfaces:
ActionListener, KeyListener, EventListener

public class Ball
extends GameObject

A Ball is a mutable object that bounces around the GameSpace


Field Summary
 
Fields inherited from class components.GameObject
center, coRef, delay, depth, frozen, g, height, name, orientAngle, orientVect, selected, shape, targets, velocity, visible, width
 
Constructor Summary
Ball(Map<String,String> p, GameSpace g)
           
Ball(Vect3 tlf, String name, GameSpace g)
           
Ball(Vect3 tlf, Vect3 velocity, String name, GameSpace g)
           
Ball(Vect3 tlf, Vect3 velocity, Vect3 ov, Angle oa, String name, GameSpace g)
           
 
Method Summary
protected  Map<String,String> defaults()
          sets all the defaults for this class.
 void getBasicPropertyMap(Map<String,String> m)
          changes the map to represent the values of this GameObject required by the xml spec
 Vect3 getDiff()
          in order for the ball to be in the middle of a grid, the center is offset by .5 from the tlf on the z axis
 GameObjectClassification getGOClassification()
          Requires that all obejects return their own classification
 Set<Vect3> getOccupiedPositions()
           
 Vect3 getTLF()
          balls have the same center and tlf, so don't do that thar rounding thing
protected  Shape shape()
          the Shape of the object
 void stepFrame()
          This is overriden in mobile objects
 
Methods inherited from class components.GameObject
action, actionPerformed, addTarget, clearTargets, equals, getBounds, getCenter, getCoRef, getDelay, getDepth, getGameSpace, getHeight, getName, getNonRoundedTLF, getOrientAngle, getOrientVector, getRoundedTLF, getShape, getTargets, getVelocity, getWidth, hashCode, isFrozen, isSelected, isVisible, onCollision, putInVect3, putInVect3, removeTarget, setCenter, setCoRef, setDelay, setDepth, setFrozen, setHeight, setOrientAngle, setOrientVect, setProperty, setSelected, setTLF, setVelocity, setVisible, setWidth, toString
 
Methods inherited from class java.awt.event.KeyAdapter
keyPressed, keyReleased, keyTyped
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Ball

public Ball(Vect3 tlf,
            Vect3 velocity,
            Vect3 ov,
            Angle oa,
            String name,
            GameSpace g)
Effects:
Contructs new Ball

Ball

public Ball(Vect3 tlf,
            Vect3 velocity,
            String name,
            GameSpace g)
Effects:
Constructs a new Ball

Ball

public Ball(Vect3 tlf,
            String name,
            GameSpace g)
Effects:
Constructs a new Ball

Ball

public Ball(Map<String,String> p,
            GameSpace g)
Method Detail

getDiff

public Vect3 getDiff()
in order for the ball to be in the middle of a grid, the center is offset by .5 from the tlf on the z axis

Overrides:
getDiff in class GameObject
Returns:
a Vect3 that points from TLF to center. by default this is the center by width, height, depth

getTLF

public Vect3 getTLF()
balls have the same center and tlf, so don't do that thar rounding thing

Overrides:
getTLF in class GameObject
Returns:
the position of this object, rounded

defaults

protected Map<String,String> defaults()
Description copied from class: GameObject
sets all the defaults for this class. override in subclass if you want different defaults must be called at the beginning of the constructor.

Overrides:
defaults in class GameObject

stepFrame

public void stepFrame()
Description copied from class: GameObject
This is overriden in mobile objects

Overrides:
stepFrame in class GameObject

getGOClassification

public GameObjectClassification getGOClassification()
Description copied from class: GameObject
Requires that all obejects return their own classification

Specified by:
getGOClassification in class GameObject
Returns:
the GameObjectClassification of this object

getBasicPropertyMap

public void getBasicPropertyMap(Map<String,String> m)
Description copied from class: GameObject
changes the map to represent the values of this GameObject required by the xml spec

Overrides:
getBasicPropertyMap in class GameObject

shape

protected Shape shape()
Description copied from class: GameObject
the Shape of the object

Specified by:
shape in class GameObject

getOccupiedPositions

public Set<Vect3> getOccupiedPositions()
Specified by:
getOccupiedPositions in class GameObject
Returns:
the top left front corners of the grid locations occupied by the Ball, where the x grid positions go from 0-20, y from 0-20, and z from 0-10