mdh.hephaestus2
Class Stuff

java.lang.Object
  |
  +--mdh.hephaestus2.Stuff
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Map, Terrain, Thing

public abstract class Stuff
extends Object
implements Serializable

Anything in the system with an id, a name, and a trigger callback.

Author:
Copyright © 2001 by Mark Hughes <kamikaze@kuoi.asui.uidaho.edu>
See Also:
Serialized Form

Method Summary
 void destroy()
          Removes this Stuff from the database.
 boolean getBlocking()
          Returns true if this Stuff will block movement.
 String getName()
          Returns the name of this Stuff.
 String getTriggerCallback()
          Returns the trigger callback of this Stuff.
abstract  int getType()
          Returns the type constant for this object, one of Global.TYPE_*.
 int id()
          Returns the unique id of this Stuff.
 boolean isType(int type)
          Returns true if this class or any of its superclasses is of 'type', one of Global.TYPE_*.
 void setBlocking(boolean b)
          If true, this Stuff will block movement; if false, it will not.
 void setName(String n)
          Sets the name of this Stuff.
 void setTriggerCallback(String t)
          Sets the trigger callback of this Stuff.
 String toString()
          Calls toString(true).
 String toString(boolean verbose)
          Produces a description of the Stuff.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

destroy

public final void destroy()
                   throws HephaestusException
Removes this Stuff from the database.

HephaestusException

getBlocking

public final boolean getBlocking()
Returns true if this Stuff will block movement.


getName

public final String getName()
Returns the name of this Stuff.


getTriggerCallback

public String getTriggerCallback()
Returns the trigger callback of this Stuff.


getType

public abstract int getType()
Returns the type constant for this object, one of Global.TYPE_*.


isType

public boolean isType(int type)
Returns true if this class or any of its superclasses is of 'type', one of Global.TYPE_*.


id

public int id()
Returns the unique id of this Stuff.


setBlocking

public final void setBlocking(boolean b)
                       throws HephaestusException
If true, this Stuff will block movement; if false, it will not.

HephaestusException

setName

public void setName(String n)
             throws HephaestusException
Sets the name of this Stuff.

HephaestusException

setTriggerCallback

public void setTriggerCallback(String t)
                        throws HephaestusException
Sets the trigger callback of this Stuff. This is the callback which will be called if a Player or Creature moves into the Stuff (if it is blocking), or "triggers" while standing above it (if it is not).

HephaestusException

toString

public final String toString()
Calls toString(true).

Overrides:
toString in class Object

toString

public final String toString(boolean verbose)
Produces a description of the Stuff.

Parameters:
verbose - If false, a brief listing in the form "[type id name]" is returned; if true, all properties are included after the name.