gizmoball.gameworld.gameobjects
Class LimitedTeleporter

java.lang.Object
  extended by gizmoball.gameworld.GameObject
      extended by gizmoball.gameworld.Gizmo
          extended by gizmoball.gameworld.gameobjects.BallShooter
              extended by gizmoball.gameworld.gameobjects.Teleporter
                  extended by gizmoball.gameworld.gameobjects.LimitedTeleporter

public class LimitedTeleporter
extends Teleporter

A LimitedTeleporter is an Teleporter that runs only when a given counter is positive. A LimitedTeleporter disappears from the WorldState when its counter is no longer positive.

Specification Fields :
counter : Counter // the score controlling this

Field Summary
 
Fields inherited from class gizmoball.gameworld.Gizmo
orientation, totalTranslation
 
Constructor Summary
LimitedTeleporter(Vect3 corner1, Vect3 corner2, Vect3 shootLoc, Vect3 shootVel, Counter counter)
          Creates a new LimitedTeleporter with the desired parameters
 
Method Summary
 void doActivate()
          Activates regardless of counter, since collisions can only happen when counter is positive.
 GraphicsProperties getGraphicsProperties()
          Returns an object that holds the information necessary for drawing this object.
 PhysicsModel getPhysicsModel()
          Returns the physical model of this gizmo.
 double getReflectionCoeff()
           
 java.lang.String getXMLString(java.lang.String name)
          returns the XML string that would be used to save this game object
 void setCoefficientOfReflection(double d)
          Sets the coefficient of reflection of this
 
Methods inherited from class gizmoball.gameworld.gameobjects.BallShooter
addBall, doUpdate, getBallPlacementDiff, getDefaultTriggers, getDelay, getFirstBallLocation, getShootSpeed, getShootTranslate, rotateAboutAxis, translateBy
 
Methods inherited from class gizmoball.gameworld.Gizmo
activate, copy, getBoundingBox, getCoeffReflectionString, getColorString, getCommonAttributesString, getOrientationDoubleString, getOrientationString, getTextureString, getTranslationString, getXMLDelay, getXMLDelayString, setCommonAttributes, setDelay, update
 
Methods inherited from class gizmoball.gameworld.GameObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LimitedTeleporter

public LimitedTeleporter(Vect3 corner1,
                         Vect3 corner2,
                         Vect3 shootLoc,
                         Vect3 shootVel,
                         Counter counter)
Creates a new LimitedTeleporter with the desired parameters

Parameters:
corner1 - one of the corners of this
corner2 - the opposite corner
shootLoc - the location the ball is shot from
shootVel - the velocity with which the ball is shot
counter - the counter that controls this
Method Detail

doActivate

public void doActivate()
Activates regardless of counter, since collisions can only happen when counter is positive.

Overrides:
doActivate in class BallShooter

getPhysicsModel

public PhysicsModel getPhysicsModel()
Description copied from class: Gizmo
Returns the physical model of this gizmo. The model stores the structure, as well as velocity, rotation, and rotation of this gizmo.

Overrides:
getPhysicsModel in class Teleporter
Returns:
either the physics model, or an empty physics model, depending on counter

getGraphicsProperties

public GraphicsProperties getGraphicsProperties()
Description copied from class: GameObject
Returns an object that holds the information necessary for drawing this object. Making changes to this object changes the underlying object, so those changes will be reflected in the drawer.

Overrides:
getGraphicsProperties in class Teleporter
Returns:
either the graphics properties, or a empty and invisible graphics properties, depending on counter

getXMLString

public java.lang.String getXMLString(java.lang.String name)
Description copied from class: GameObject
returns the XML string that would be used to save this game object

Overrides:
getXMLString in class Teleporter
Returns:
String s where s is sufficient to be directly inserted into an XML file where game world information is being saved

getReflectionCoeff

public double getReflectionCoeff()
Overrides:
getReflectionCoeff in class Gizmo
Returns:
this.reflectionCoeff

setCoefficientOfReflection

public void setCoefficientOfReflection(double d)
Sets the coefficient of reflection of this

Overrides:
setCoefficientOfReflection in class Gizmo
Requires:
0 <= d <= 1
Effects:
this.reflectionCoeff = d