wyvern.kernel.monsters
Class HeartbeatManager

java.lang.Object
  extended bywyvern.kernel.monsters.HeartbeatManager
All Implemented Interfaces:
Timed

public final class HeartbeatManager
extends java.lang.Object
implements Timed

This class makes sure all monsters get a heartbeat, and allows other game objects to register for heartbeat notifications as well.

Version:
1.0, Jun 05, 1998
Author:
Steve Yegge

Field Summary
static int HEARTBEAT_INTERVAL
          The delay (in millis) between heartbeats in the game.
 
Method Summary
static void add(HeartbeatCallback obj)
          Adds an object to the set of callbacks receiving heartbeat notifications.
static boolean contains(HeartbeatCallback obj)
          Returns true if the specified object is receiving heartbeat notifications.
static java.lang.String getProfilingInfo()
          Returns info about the objects on the monitor.
static void remove(HeartbeatCallback obj)
          Removes an object from the heartbeat list.
static void start()
          For bootstrapping the object.
 void timerExpired()
          Callback for timer notification.
 java.lang.String toString()
          Returns String description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HEARTBEAT_INTERVAL

public static final int HEARTBEAT_INTERVAL
The delay (in millis) between heartbeats in the game. Lots of code depends on this being exactly 5 seconds, so don't change it unless you want chaos and unhappiness.

See Also:
Constant Field Values
Method Detail

start

public static void start()
For bootstrapping the object.


add

public static void add(HeartbeatCallback obj)
Adds an object to the set of callbacks receiving heartbeat notifications.


remove

public static void remove(HeartbeatCallback obj)
Removes an object from the heartbeat list. Doesn't flag an exception if the callback isn't in the list.


contains

public static boolean contains(HeartbeatCallback obj)
Returns true if the specified object is receiving heartbeat notifications.


timerExpired

public void timerExpired()
Callback for timer notification. Calls all heartbeat objects.

Specified by:
timerExpired in interface Timed

getProfilingInfo

public static java.lang.String getProfilingInfo()
Returns info about the objects on the monitor.


toString

public java.lang.String toString()
Returns String description.