Atavism Version 2018.1AGIS API

atavism.server.messages
Class PerceptionMessage

java.lang.Object
  extended by atavism.msgsys.Message
      extended by atavism.server.messages.PerceptionMessage
All Implemented Interfaces:
HasTarget, java.io.Serializable

public class PerceptionMessage
extends Message
implements HasTarget

Changes to the objects perceived by a target object. The PerceptionMessage contains a list of gained objects and a list of lost objects. Gained objects are newly perceived and lost objects are no longer perceivable.

Gained and lost objects are each described by an PerceptionMessage.ObjectNote. The ObjectNote contains the object OID (subject) and object type. The ObjectNote may optionally contain some arbitrary object information (see PerceptionMessage.ObjectNote.getObjectInfo()).

ObjectNote supports a different target for each perceived object, but this capability is currently not used and may become deprecated.

See Also:
Serialized Form

Nested Class Summary
static class PerceptionMessage.ObjectNote
          Described a gained or lost perceivable object.
 
Constructor Summary
PerceptionMessage()
          No-arg constructor required for marshalling.
PerceptionMessage(MessageType msgType)
          Create message of the given message type.
PerceptionMessage(MessageType msgType, OID target)
          Create message of the given message type and target.
 
Method Summary
 PerceptionMessage.ObjectNote gainObject(OID targetOid, OID subjectOid, ObjectType objectType)
          Add a gained object.
 void gainObject(PerceptionMessage.ObjectNote note)
          Add a gained object.
 int getGainObjectCount()
          Get number of gained objects.
 java.util.List<PerceptionMessage.ObjectNote> getGainObjects()
          Get gained object list.
 int getLostObjectCount()
          Get number of lost objects.
 java.util.List<PerceptionMessage.ObjectNote> getLostObjects()
          Get lost object list.
 OID getTarget()
          Get the message target.
 void lostObject(OID targetOid, OID subjectOid)
          Add a lost object.
 void lostObject(OID targetOid, OID subjectOid, ObjectType objectType)
          Add a lost object.
 void lostObject(PerceptionMessage.ObjectNote note)
          Add a lost object.
 void setTarget(OID target)
          Set the message target OID.
 
Methods inherited from class atavism.msgsys.Message
getEnqueueTime, getMsgId, getMsgType, getSenderName, isRPC, setEnqueueTime, setEnqueueTime, setMsgType, toBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerceptionMessage

public PerceptionMessage()
No-arg constructor required for marshalling.


PerceptionMessage

public PerceptionMessage(MessageType msgType)
Create message of the given message type.


PerceptionMessage

public PerceptionMessage(MessageType msgType,
                         OID target)
Create message of the given message type and target.

Method Detail

getTarget

public OID getTarget()
Get the message target.

Specified by:
getTarget in interface HasTarget
Returns:
OID

setTarget

public void setTarget(OID target)
Set the message target OID.

Specified by:
setTarget in interface HasTarget

gainObject

public PerceptionMessage.ObjectNote gainObject(OID targetOid,
                                               OID subjectOid,
                                               ObjectType objectType)
Add a gained object.


gainObject

public void gainObject(PerceptionMessage.ObjectNote note)
Add a gained object.


lostObject

public void lostObject(OID targetOid,
                       OID subjectOid)
Add a lost object.


lostObject

public void lostObject(OID targetOid,
                       OID subjectOid,
                       ObjectType objectType)
Add a lost object.


lostObject

public void lostObject(PerceptionMessage.ObjectNote note)
Add a lost object.


getGainObjects

public java.util.List<PerceptionMessage.ObjectNote> getGainObjects()
Get gained object list.

Returns:
null if there are no gained objects.

getLostObjects

public java.util.List<PerceptionMessage.ObjectNote> getLostObjects()
Get lost object list.

Returns:
null if there are no lost objects.

getGainObjectCount

public int getGainObjectCount()
Get number of gained objects.


getLostObjectCount

public int getLostObjectCount()
Get number of lost objects.



Copyright © 2018 Dragonsan Studios Sp. z o.o.