Package org.vrspace.server.obj
Class Bot
- java.lang.Object
-
- org.vrspace.server.obj.Entity
-
- org.vrspace.server.obj.VRObject
-
- org.vrspace.server.obj.Client
-
- org.vrspace.server.obj.User
-
- org.vrspace.server.obj.Bot
-
-
Constructor Summary
Constructors Constructor Description Bot()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetParameter(String key)Returns a parameter from parameter mapabstract StringgetResponse(Client c, String query)voidobjectsAdded(List<VRObject> objects)New objects in the scene, typically a client that has arrived.voidobjectsRemoved(List<Map<String,Long>> objects)Objects removed from the scene, typically a client that has left.voidprocessEvent(VREvent event)Process an event.voidrespondTo(Client c, String what)Get response to something that a client "said", and write itabstract voidselfTest()Self test runs on server startup.voidsendMessage(Object o)Scene management method, called when the scene changes.StringtoString()voidwrite(String what)Utility method - "say" something.-
Methods inherited from class org.vrspace.server.obj.User
createScene
-
Methods inherited from class org.vrspace.server.obj.Client
clearToken, getToken, setToken
-
Methods inherited from class org.vrspace.server.obj.VRObject
active, addChildren, addListener, getObjectId, isActive, isPermanent, isTemporary, notifyListeners, passive, removeListener, setWorld
-
-
-
-
Method Detail
-
selfTest
public abstract void selfTest() throws ExceptionSelf test runs on server startup. Exceptions are logged but otherwise ignored.- Throws:
Exception
-
respondTo
public void respondTo(Client c, String what)
Get response to something that a client "said", and write it
-
write
public void write(String what)
Utility method - "say" something.
-
processEvent
public void processEvent(VREvent event)
Process an event. If that's something that a user wrote, calls respondTo method. Other events are ignored.- Overrides:
processEventin classClient- Parameters:
event- Whatever has changed
-
objectsAdded
public void objectsAdded(List<VRObject> objects)
New objects in the scene, typically a client that has arrived. This implementation does nothing, utility method for subclasses.
-
objectsRemoved
public void objectsRemoved(List<Map<String,Long>> objects)
Objects removed from the scene, typically a client that has left. This implementation does nothing, utility method for subclasses.- Parameters:
objects-
-
sendMessage
public void sendMessage(Object o)
Scene management method, called when the scene changes.- Overrides:
sendMessagein classClient
-
-