com.threerings.micasa.simulator.server
Class Simulant

java.lang.Object
  extended by com.threerings.micasa.simulator.server.Simulant

public abstract class Simulant
extends Object


Field Summary
protected  GameConfig _config
          The game config object.
protected  GameManager _gmgr
          The game manager for the game we're playing.
protected  DObjectManager _omgr
          The object manager with which we're interacting.
protected  BodyObject _self
          Our body object.
 
Constructor Summary
Simulant()
           
 
Method Summary
 void init(BodyObject self, GameConfig config, GameManager gmgr, DObjectManager omgr)
          Initializes the simulant with a body object and the game config for the game they'll be engaged in.
protected  void postEvent(MessageEvent mevt)
          Posts the given message event to the server.
 void willEnterPlace(PlaceObject plobj)
          Called when the simulant is about to enter the room in which it will be doing all of its business.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_config

protected GameConfig _config
The game config object.


_gmgr

protected GameManager _gmgr
The game manager for the game we're playing.


_self

protected BodyObject _self
Our body object.


_omgr

protected DObjectManager _omgr
The object manager with which we're interacting.

Constructor Detail

Simulant

public Simulant()
Method Detail

init

public void init(BodyObject self,
                 GameConfig config,
                 GameManager gmgr,
                 DObjectManager omgr)
Initializes the simulant with a body object and the game config for the game they'll be engaged in.


willEnterPlace

public void willEnterPlace(PlaceObject plobj)
Called when the simulant is about to enter the room in which it will be doing all of its business. Default implementation immediately notifies the game manager that the simulant is ready to play. Sub-classes may wish to override this to do things like subscribe to the game object, but should be sure to call this method when they're finished to give the game manager the go-ahead to proceed.


postEvent

protected void postEvent(MessageEvent mevt)
Posts the given message event to the server. Since the simulant resides within the server itself, it has no available client distributed object manager and so we must set up the source oid ourselves before sending it on its merry way. Sub-classes should accordingly be sure to make use of this method to send any messages.