|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MHInteractive
This interface is implemented by all objects in the game universe that must interact with each other. It defines a standard set of methods indicating the different ways that one object can act upon another.
Method Summary | |
---|---|
void |
activate(MHActor actor)
To be called when an "activate" command is issued to an object. |
java.lang.String |
examine()
Returns a description of a game object. |
java.lang.String |
getName()
Returns the name of a game object. |
int |
hitByWeapon(MHWeapon weapon)
To be called when an object implementing this interface is hit by a weapon. |
boolean |
isTraversable()
Returns true if the actor implementing this interface can be "walked" over. |
void |
movingTo(MHActor actor)
To be triggered when an actor begins moving toward an object implementing this interface. |
void |
pickUp(MHActor actor)
To be called when a character picks up an item. |
void |
steppedOff(MHActor actor)
To be triggered when an actor steps off of an object implementing this interface. |
void |
steppedOn(MHActor actor)
To be triggered when an actor steps on an object implementing this interface. |
Method Detail |
---|
void movingTo(MHActor actor)
actor
- The actor who is moving toward this object.void steppedOn(MHActor actor)
actor
- The actor who stepped on this object.void steppedOff(MHActor actor)
actor
- The actor who stepped off of this object.int hitByWeapon(MHWeapon weapon)
If the object that was "hit" is not an obstacle and therefore should not stop a projectile from travelling on, the method should return -1 to indicate this.
If the object that was hit is an obstacle but is not destructible, the method should return 0.
weapon
- The weapon that hit this object.
void activate(MHActor actor)
actor
- The actor that originated the "activate"
command.java.lang.String examine()
java.lang.String getName()
void pickUp(MHActor actor)
actor
- The character who is picking up the item.boolean isTraversable()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |