public class Event
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Event.EventClass
Event explanations for sending Events to the Client:
SEND_EXPRESSION will be handled by animating the VH face.
|
static class |
Event.SubClass |
Modifier | Constructor and Description |
---|---|
protected |
Event(int owner,
Event.EventClass eventClass)
Specialized constructor used to create a GAME_START or GAME_END event.
|
|
Event(int owner,
Event.EventClass eventClass,
Event.SubClass sc,
int value,
java.lang.String message,
int delay)
Constructor used to create a SEND_MESSAGE event with an integer value (for BATNA etc.)
|
|
Event(int owner,
Event.EventClass eventClass,
Event.SubClass sc,
java.lang.String message,
int delay)
Constructor used to create a SEND_MESSAGE event
|
|
Event(int owner,
Event.EventClass eventClass,
int delay)
Constructor used to create a FORMAL_ACCEPT, FORMAL_QUIT or OFFER_IN_PROGRESS event.
|
|
Event(int owner,
Event.EventClass eventClass,
int value,
java.lang.String message,
int delay)
Constructor used to create a SEND_MESSAGE event with an integer value (for BATNA etc.)
|
|
Event(int owner,
Event.EventClass eventClass,
Offer offer)
Deprecated.
|
|
Event(int owner,
Event.EventClass eventClass,
Offer offer,
int delay)
Constructor used to create a SEND_OFFER event.
|
protected |
Event(int owner,
Event.EventClass eventClass,
Offer offer,
java.lang.String message,
int delay)
Specialized constructor usable only by IAGO to add message descriptions of offers.
|
protected |
Event(int owner,
Event.EventClass eventClass,
java.lang.String time)
Specialized constructor used to create a TIME event.
|
|
Event(int owner,
Event.EventClass eventClass,
java.lang.String message,
int delay)
Constructor used to create a SEND_MESSAGE event
|
|
Event(int owner,
Event.EventClass eventClass,
java.lang.String emotion,
int duration,
int delay)
Constructor used to create a SEND_EXPRESSION event
|
Modifier and Type | Method and Description |
---|---|
void |
encodeMessageCode(int code)
Specialized method for sending the ID of a known plaintext message to make text parsing easier.
|
void |
encodePreferenceData(Preference preference)
Specialized method for sending messages as the more easily parsable Preference class.
|
boolean |
equals(java.lang.Object ePrime)
Method to find if every important characteristic of an event is identical to those of another.
|
int |
getDelay()
Provides the length of time to wait before executing the Event, in milliseconds.
|
int |
getDuration()
Provides the length of time an Event will be displayed, in milliseconds.
|
java.lang.String |
getMessage()
Provides the message stored in the Event that calls the method.
|
int |
getMessageCode()
Deprecated.
MessageCode have been replaced with the SubClass system.
|
Offer |
getOffer()
Provides the Offer stored in the Event that calls the method.
|
int |
getOwner()
Provides the owner of the event that calls the method.
|
Preference |
getPreference()
Provides the preference stored in the Event that calls the method.
|
Event.SubClass |
getSubClass()
Provides the type of the event that calls the method.
|
Event.EventClass |
getType()
Provides the type of the event that calls the method.
|
int |
getValue()
Provides the value in the Event, such as a BATNA value included with a message.
|
boolean |
isFlushable()
Determines whether or not this Event is classified as "Flushable." Flushable events will be removed from the event queues whenever a priority
Event is sent.
|
boolean |
isPriority()
Determines whether or not this Event is classified as "Priority." Priority events will flush all flushable Events that are in the queue.
|
void |
setFlushable(boolean flushable)
Sets whether or not this Event can be flushable.
|
void |
setOwner(int owner)
Sets the owner of an event.
|
void |
setPriority(boolean prio)
Sets the priority of an Event.
|
@Deprecated public Event(int owner, Event.EventClass eventClass, Offer offer)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a SEND_OFFER)offer
- the offerpublic Event(int owner, Event.EventClass eventClass, int delay)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a FORMAL_ACCEPT or OFFER_IN_PROGRESS)delay
- delay in millisecondspublic Event(int owner, Event.EventClass eventClass, java.lang.String emotion, int duration, int delay)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a SEND_EXPRESSION)emotion
- the emotion to send. Currently supported are: angry, happy, surprised, disgusted, afraid, neutral, sad, insincereSmileduration
- the length of time, in ms, to display the emotiondelay
- the delay in millisecondspublic Event(int owner, Event.EventClass eventClass, java.lang.String message, int delay)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a SEND_MESSAGE)message
- the message to senddelay
- the delay in millisecondspublic Event(int owner, Event.EventClass eventClass, int value, java.lang.String message, int delay)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a SEND_MESSAGE)value
- an integer representing a BATNA or any other value to be sent through a messagemessage
- the message to senddelay
- the delay in millisecondspublic Event(int owner, Event.EventClass eventClass, Event.SubClass sc, java.lang.String message, int delay)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a SEND_MESSAGE)message
- the message to senddelay
- the delay in millisecondssc
- the subclass of the messagepublic Event(int owner, Event.EventClass eventClass, Event.SubClass sc, int value, java.lang.String message, int delay)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a SEND_MESSAGE)value
- an integer representing a BATNA or any other value to be sent through a messagemessage
- the message to senddelay
- the delay in millisecondssc
- the subclass of the messageprotected Event(int owner, Event.EventClass eventClass)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a GAME_START or GAME_END)protected Event(int owner, Event.EventClass eventClass, java.lang.String time)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a TIME)public Event(int owner, Event.EventClass eventClass, Offer offer, int delay)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a SEND_OFFER)offer
- the offerdelay
- the delay in millisecondsprotected Event(int owner, Event.EventClass eventClass, Offer offer, java.lang.String message, int delay)
owner
- the integer representing the owner, which matches the ID in History (System = -1, User = 0, Opponent = 1)eventClass
- the type of Event (here, only a SEND_OFFER)offer
- the offer to add a message description tomessage
- the message associated with the offerdelay
- the delay in millisecondspublic void encodePreferenceData(Preference preference)
preference
- the preference to sendpublic void encodeMessageCode(int code)
code
- the known integer code of a given messagepublic Event.EventClass getType()
public Event.SubClass getSubClass()
public java.lang.String getMessage()
public Offer getOffer()
public int getDelay()
public int getOwner()
public void setOwner(int owner)
owner
- The int of the owner of an event. This should match an ID in History (System = -1, User = 0, Opponent = 1)public Preference getPreference()
public int getMessageCode()
public int getDuration()
public int getValue()
public boolean isPriority()
public void setPriority(boolean prio)
prio
- true if the agent wants the Event to have priority. False if it does not.public boolean isFlushable()
public void setFlushable(boolean flushable)
flushable
- true if the agent wants the Event to be removed from the queue when it sends a priority Event. False if the agent wants the Event to be processed regardless.public boolean equals(java.lang.Object ePrime)
equals
in class java.lang.Object
boolean
- whether the two events are equal or not