All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.loki3.cyber.pawn.PawnClass

java.lang.Object
    |
    +----com.loki3.pa.Item
            |
            +----com.loki3.cyber.pawn.UnitClass
                    |
                    +----com.loki3.cyber.pawn.PawnClass

public class PawnClass
extends UnitClass
implements Pawn
Pawn is the primary class for controlling your pawn and getting information about it.


Constructor Index

 o PawnClass()
 

Method Index

 o changeSpeed(double)
Change pawn's speed.
 o collision(Item)
Check for the results of a collision.
 o draw(Graphics, ViewTransform)
Display pawn & all its sub-objects.
 o getAcceleration()
Get the maximum rate at which pawn's speed can change per tick
 o getAngleAcceleration()
Get the rate at which the pawn can turn (in radians)
 o getCurrentSpeed()
Get pawn's current speed
 o getEnergy()
Get the object which tracks the pawn's energy.
 o getIdentity()
Get a list of names the object goes by
 o getMaker()
object which can publicly create us
 o getMaxSpeed()
Get the maximum speed pawn can travel
 o getScanners()
Get list of pawn's scanners.
 o getTools()
Get list of pawn's tools.
 o getWeapons()
Get list of pawn's weapons.
 o setItems(Items)
sub-units may need to track master list of units
 o turnLeft(double)
Change direction pawn is headed in by turning left by the given angle.
 o turnRight(double)
Change direction pawn is headed in by turning right by the given angle.
 o update(double)
 

Constructor Detail

 o PawnClass
public PawnClass()

Method Detail

 o getMaker
public static java.lang.Object getMaker()
          object which can publicly create us
 o getCurrentSpeed
public double getCurrentSpeed()
          Get pawn's current speed
 o getMaxSpeed
public double getMaxSpeed()
          Get the maximum speed pawn can travel
 o getAcceleration
public double getAcceleration()
          Get the maximum rate at which pawn's speed can change per tick
 o getAngleAcceleration
public double getAngleAcceleration()
          Get the rate at which the pawn can turn (in radians)
 o changeSpeed
public boolean changeSpeed(double speed)
          Change pawn's speed. Note it may take awhile for pawn to achieve new speed.
Parameters:
speed - value from 0 to getMaxSpeed()
Returns:
false if pawn cannot reach desired speed
 o turnLeft
public boolean turnLeft(double angle)
          Change direction pawn is headed in by turning left by the given angle. Note it may take awhile for pawn to turn in given direction
Parameters:
angle - angle in radians
Returns:
false if pawn cannot turn in desired direction
 o turnRight
public boolean turnRight(double angle)
          Change direction pawn is headed in by turning right by the given angle. Note it may take awhile for pawn to turn in given direction
Parameters:
angle - angle in radians
Returns:
false if pawn cannot turn in desired direction
 o getEnergy
public Energy getEnergy()
          Get the object which tracks the pawn's energy.
 o getScanners
public java.util.Enumeration getScanners()
          Get list of pawn's scanners.
 o getWeapons
public java.util.Enumeration getWeapons()
          Get list of pawn's weapons.
 o getTools
public java.util.Enumeration getTools()
          Get list of pawn's tools.
 o getIdentity
public Identity getIdentity()
          Get a list of names the object goes by
Overrides:
getIdentity in class UnitClass
 o draw
public void draw(java.awt.Graphics graf,
                 com.loki3.pa.ViewTransform view)
          Display pawn & all its sub-objects.
Overrides:
draw in class com.loki3.pa.Item
 o update
public void update(double tick)
Overrides:
update in class com.loki3.pa.Item
 o collision
public void collision(com.loki3.pa.Item item)
          Check for the results of a collision.
Overrides:
collision in class com.loki3.pa.Item
 o setItems
public void setItems(com.loki3.pa.Items items)
          sub-units may need to track master list of units

All Packages  Class Hierarchy  This Package  Previous  Next  Index