hermes
Class HObject

java.lang.Object
  extended by hermes.HObject
All Implemented Interfaces:
KeySubscriber, MouseSubscriber, MouseWheelSubscriber, OscSubscriber
Direct Known Subclasses:
Being

public abstract class HObject
extends java.lang.Object
implements KeySubscriber, MouseSubscriber, MouseWheelSubscriber, OscSubscriber

Basic game object class.

All parts of game are represented as HObjects.

For most uses, extend the Being class

Extend HObject directly when you want to represent something more abstract, like game state.


Constructor Summary
protected HObject()
           
 
Method Summary
protected  void addToGroup(GenericGroup group)
          adds the HObject to the group
protected  void delete()
          removes the HObject from all containing groups
protected  java.util.Iterator<GenericGroup> getGroups()
          Returns an iterator over all the groups the object is a member of.
 boolean needsMoreSamples()
          Used for multisampling -- if true the object needs to be sampled more on the current update.
 void receive(KeyMessage m)
          Override if you want your Being to handle Key messages
 void receive(MouseMessage m)
          Override if you want your Being to handle Mouse messages
 void receive(MouseWheelMessage m)
          Override if you want your Being to handle Mouse Wheel messages
 void receive(OscMessage m)
          Override if you want your Being to handle OSC messages
protected  void removeFromGroup(GenericGroup group)
          removes the HObject from this group
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HObject

protected HObject()
Method Detail

addToGroup

protected void addToGroup(GenericGroup group)
adds the HObject to the group

Parameters:
group - the group to add to

removeFromGroup

protected void removeFromGroup(GenericGroup group)
removes the HObject from this group

Parameters:
group - the group to remove from

delete

protected void delete()
removes the HObject from all containing groups


getGroups

protected java.util.Iterator<GenericGroup> getGroups()
Returns an iterator over all the groups the object is a member of.

Returns:
iterators over the groups containing this object

needsMoreSamples

public boolean needsMoreSamples()
Used for multisampling -- if true the object needs to be sampled more on the current update.

Returns:
whether the object needs more samples this update

receive

public void receive(KeyMessage m)
Override if you want your Being to handle Key messages

Specified by:
receive in interface KeySubscriber
Parameters:
m - the message sent by the PostOffice

receive

public void receive(MouseMessage m)
Override if you want your Being to handle Mouse messages

Specified by:
receive in interface MouseSubscriber
Parameters:
m - the message sent by the PostOffice

receive

public void receive(MouseWheelMessage m)
Override if you want your Being to handle Mouse Wheel messages

Specified by:
receive in interface MouseWheelSubscriber
Parameters:
m - the message sent by the PostOffice

receive

public void receive(OscMessage m)
Override if you want your Being to handle OSC messages

Specified by:
receive in interface OscSubscriber
Parameters:
m - the message sent by the PostOffice