|
|||||||||
Atavism Version 2018.1 | AGIS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatavism.server.objects.MessageRegionTrigger
public class MessageRegionTrigger
Publish a message when object enters or leaves a custom region. Register with WorldManagerPlugin.registerRegionTrigger(String,RegionTrigger).
The trigger has two modes: subject and target. In subject mode, the trigger publishes a SubjectMessage sub-class which will be received by all perceivers of the subject (the player). In target mode, the trigger publishes a TargetMessage sub-class which will apply only to the object itself.
The trigger can add a fixed set of properties to each message. And the properties can be filtered by a set of property exclusions. The message will always have a "regionAction" property set to either "onEnter" or "onLeave" indicating which action triggered the message.
The remaining trigger behavior is controled by custom region properties:
Field Summary | |
---|---|
static int |
SUBJECT_MODE
Publish a 'subject' message (SubjectMessage sub-class). |
static int |
TARGET_MODE
Publish a 'targeted' message (TargetMessage sub-class). |
Constructor Summary | |
---|---|
MessageRegionTrigger()
|
|
MessageRegionTrigger(int mode)
|
|
MessageRegionTrigger(int mode,
java.util.Map<java.lang.String,java.io.Serializable> messageProperties,
java.util.Set<java.lang.String> propertyExclusions)
|
Method Summary | |
---|---|
protected void |
configureMessage(Message message,
AOObject obj,
Region region,
java.lang.String action)
|
protected void |
copyProperties(java.lang.String propertyNames,
java.util.Map<java.lang.String,java.io.Serializable> source,
java.util.Map<java.lang.String,java.io.Serializable> destination)
|
void |
enter(AOObject obj,
Region region)
Send message when object enters a region. |
java.util.Map<java.lang.String,java.io.Serializable> |
getMessageProperties()
Get the additional message properties. |
int |
getMode()
Get the trigger mode. |
java.util.Set<java.lang.String> |
getPropertyExclusions()
Get the property exclusions. |
void |
leave(AOObject obj,
Region region)
Send message when object leaves a region. |
protected Message |
makeMessage(AOObject obj,
Region region)
|
void |
setMessageProperties(java.util.Map<java.lang.String,java.io.Serializable> messageProperties)
Set the additional message properties. |
void |
setMode(int mode)
Set the trigger mode to TARGET_MODE or SUBJECT_MODE. |
void |
setPropertyExclusions(java.util.Set<java.lang.String> propertyExclusions)
Set the property exclusions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TARGET_MODE
public static final int SUBJECT_MODE
Constructor Detail |
---|
public MessageRegionTrigger()
public MessageRegionTrigger(int mode)
public MessageRegionTrigger(int mode, java.util.Map<java.lang.String,java.io.Serializable> messageProperties, java.util.Set<java.lang.String> propertyExclusions)
Method Detail |
---|
public int getMode()
public void setMode(int mode)
public java.util.Map<java.lang.String,java.io.Serializable> getMessageProperties()
public void setMessageProperties(java.util.Map<java.lang.String,java.io.Serializable> messageProperties)
public java.util.Set<java.lang.String> getPropertyExclusions()
public void setPropertyExclusions(java.util.Set<java.lang.String> propertyExclusions)
public void enter(AOObject obj, Region region)
enter
in interface RegionTrigger
public void leave(AOObject obj, Region region)
leave
in interface RegionTrigger
protected Message makeMessage(AOObject obj, Region region)
protected void configureMessage(Message message, AOObject obj, Region region, java.lang.String action)
protected void copyProperties(java.lang.String propertyNames, java.util.Map<java.lang.String,java.io.Serializable> source, java.util.Map<java.lang.String,java.io.Serializable> destination)
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |