components
Class Flipper

java.lang.Object
  extended by java.awt.event.KeyAdapter
      extended by components.GameObject
          extended by components.Flipper
All Implemented Interfaces:
ActionListener, KeyListener, EventListener
Direct Known Subclasses:
LeftFlipper, RightFlipper

public abstract class Flipper
extends GameObject

A Flipper is a mutable object that represents a flipper in the game A flipper

Specification Fields

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
Flipper(Map<String,String> props, GameSpace gs)
           
Flipper(Vect3 tlf, Vect3 center, Vect3 ov, Angle oa, String name, GameSpace g)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
          This is overriden in objects where something actually occurs when triggered, for example, Flippers
protected  Map<String,String> defaults()
          default coref for flippers is 0.95.
 Vect3 getAngularVelocity()
           
abstract  Vect3 getDiff()
          Difference between TLF and center.
 GameObjectClassification getGOClassification()
          Requires that all obejects return their own classification
 Set<Vect3> getOccupiedPositions()
           
 Angle getOrientAngle()
           
protected  Shape shape()
          the Shape of the object
 void stepFrame()
          This is overriden in mobile objects
 
Methods inherited from class components.GameObject
action, addTarget, clearTargets, equals, getBasicPropertyMap, getBounds, getCenter, getCoRef, getDelay, getDepth, getGameSpace, getHeight, getName, getNonRoundedTLF, getOrientVector, getRoundedTLF, getShape, getTargets, getTLF, 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

Flipper

public Flipper(Vect3 tlf,
               Vect3 center,
               Vect3 ov,
               Angle oa,
               String name,
               GameSpace g)
Effects:
constructs a new flipper

Flipper

public Flipper(Map<String,String> props,
               GameSpace gs)
Method Detail

getDiff

public abstract Vect3 getDiff()
Description copied from class: GameObject
Difference between TLF and center. ZERO for balls, so should be overridden

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

shape

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

Specified by:
shape in class GameObject

defaults

protected Map<String,String> defaults()
default coref for flippers is 0.95. also, flippers require an orientation.

Overrides:
defaults in class GameObject

getOrientAngle

public Angle getOrientAngle()
Overrides:
getOrientAngle in class GameObject
Returns:
the orientation angle of the object

actionPerformed

public void actionPerformed(ActionEvent e)
Description copied from class: GameObject
This is overriden in objects where something actually occurs when triggered, for example, Flippers

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class GameObject
Effects:
changes homeState to the opposite boolean value

stepFrame

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

Overrides:
stepFrame in class GameObject
Effects:
if flipper is in home state, but its angle is not 0 degrees, decrease the angle by the radians/frame. if flipper is not in home state, but its angle is not 90 degrees, increase the angle by the radians/frame.

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

getOccupiedPositions

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

getAngularVelocity

public Vect3 getAngularVelocity()
Returns:
the direction of the vector represents the axis about which it rotates, the magnitude of the vector is how fast, in rad/sec