com.threerings.media.util
Class DelegatingPathable

java.lang.Object
  extended by com.threerings.media.util.DelegatingPathable
All Implemented Interfaces:
Pathable

public class DelegatingPathable
extends Object
implements Pathable

Delegates all calls to a delegate pathable. One would derive from this class and override just the methods in which that one desired to intervene.


Field Summary
protected  Pathable _delegate
           
 
Constructor Summary
DelegatingPathable(Pathable delegate)
           
 
Method Summary
 Rectangle getBounds()
          Returns the rectangle that bounds the pathable.
 int getOrientation()
          Should return the orientation of the pathable, or DirectionCodes.NONE if the pathable does not support orientation.
 int getX()
          Returns the pathable's current x coordinate.
 int getY()
          Returns the pathable's current y coordinate.
 void pathBeginning()
          Called by a path when this pathable is made to start along a path.
 void pathCompleted(long timestamp)
          Called by a path when this pathable finishes moving along its path.
 void setLocation(int x, int y)
          Updates the pathable's current coordinates.
 void setOrientation(int orient)
          Will be called by a path when it moves the pathable in the specified direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_delegate

protected Pathable _delegate
Constructor Detail

DelegatingPathable

public DelegatingPathable(Pathable delegate)
Method Detail

getX

public int getX()
Description copied from interface: Pathable
Returns the pathable's current x coordinate.

Specified by:
getX in interface Pathable

getY

public int getY()
Description copied from interface: Pathable
Returns the pathable's current y coordinate.

Specified by:
getY in interface Pathable

getBounds

public Rectangle getBounds()
Description copied from interface: Pathable
Returns the rectangle that bounds the pathable.

Specified by:
getBounds in interface Pathable

setLocation

public void setLocation(int x,
                        int y)
Description copied from interface: Pathable
Updates the pathable's current coordinates.

Specified by:
setLocation in interface Pathable

setOrientation

public void setOrientation(int orient)
Description copied from interface: Pathable
Will be called by a path when it moves the pathable in the specified direction. Pathables that wish to face in the direction they are moving can take advantage of this callback.

Specified by:
setOrientation in interface Pathable
See Also:
DirectionCodes

getOrientation

public int getOrientation()
Description copied from interface: Pathable
Should return the orientation of the pathable, or DirectionCodes.NONE if the pathable does not support orientation.

Specified by:
getOrientation in interface Pathable

pathBeginning

public void pathBeginning()
Description copied from interface: Pathable
Called by a path when this pathable is made to start along a path.

Specified by:
pathBeginning in interface Pathable

pathCompleted

public void pathCompleted(long timestamp)
Description copied from interface: Pathable
Called by a path when this pathable finishes moving along its path.

Specified by:
pathCompleted in interface Pathable