edu.gatech.cs2335.lemmings.engine
Class Lemming

java.lang.Object
  extended byedu.gatech.cs2335.lemmings.physics.PhysicsObject
      extended byedu.gatech.cs2335.lemmings.engine.Lemming
All Implemented Interfaces:
ICleanable

public final class Lemming
extends PhysicsObject
implements ICleanable

Represents a generic lemming, that can move around, and do stuff. What exactly it does is decided by the lemming's occupation.

Author:
Vladimir Urazov
See Also:
LemmingJob

Constructor Summary
Lemming()
          Creates a new Lemming instance.
 
Method Summary
 void cleanUp()
          Describe cleanUp method here.
 LemmingJob getOccupation()
          Access method for the occupation property.
 PhysicsObject getPhysics()
          Access method for the physics property.
 void setOccupation(LemmingJob job)
          Describe setOccupation method here.
 void setOccupation(java.lang.String id)
          Sets the value of the occupation property.
 java.lang.String toString()
          Returns a string representation of a lemming.
 void updateDirection()
          This method should be called whenever the lemming's direction changes.
 
Methods inherited from class edu.gatech.cs2335.lemmings.physics.PhysicsObject
accelerate, getGravityUpdates, getPosition, getVelocity, isFalling, setGravityUpdates, setPosition, setPosition, setVelocity, updatePosition, updatePosition, updateVelocity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Lemming

public Lemming()
Creates a new Lemming instance.

Method Detail

cleanUp

public void cleanUp()
Describe cleanUp method here.

Specified by:
cleanUp in interface ICleanable

getOccupation

public LemmingJob getOccupation()
Access method for the occupation property.

Returns:
the current value of the occupation property

setOccupation

public void setOccupation(java.lang.String id)
Sets the value of the occupation property.

Parameters:
id - the id of the occupation to give this lemming.

setOccupation

public void setOccupation(LemmingJob job)
Describe setOccupation method here.

Parameters:
job - a LemmingJob value

getPhysics

public PhysicsObject getPhysics()
Access method for the physics property.

Returns:
the current value of the physics property

updateDirection

public void updateDirection()
This method should be called whenever the lemming's direction changes. It will update the current animation with the new direction of movement.


toString

public java.lang.String toString()
Returns a string representation of a lemming.

Overrides:
toString in class PhysicsObject
Returns:
a String value