Package marauroa.common.game
Class RPEvent
java.lang.Object
marauroa.common.game.Attributes
marauroa.common.game.SlotOwner
marauroa.common.game.RPEvent
- All Implemented Interfaces:
Cloneable,Iterable<String>,Serializable
- Direct Known Subclasses:
AttackEvent,BestiaryEvent,BuddyLoginEvent,BuddyLogoutEvent,ExamineEvent,GlobalVisualEffectEvent,GroupChangeEvent,GroupInviteEvent,HealedEvent,ImageEffectEvent,PlayerLoggedOnEvent,PlayerLoggedOutEvent,PrivateTextEvent,ProgressStatusEvent,ReachedAchievementEvent,ShowItemListEvent,ShowOutfitListEvent,SoundEvent,TextEvent,TradeStateChangeEvent,TransitionGraphEvent,ViewChangeEvent
This class implements an event. It is something that happens along the turn
duration and it is hard to represent as an attribute because it just happen
and disappear after that or because it happens several times per turn.
One interesting example of this would be private chat.
When you write private messages, it is added inside the target player, but
you can't represent that as an attribute because it two private chat messages
happen at the same time, one of them would be lost.
So solution to this problem is add each them as RPEvent.
A RPEvent is always linked to an RPObject.
- Author:
- miguel, hendrik
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()This method create a copy of the slotbooleanReturns true if two objects are exactly equalvoidCopy constructorgetName()Return the name of the eventinthashCode()voidDeserializevoidSet the owner of this RPEvent.toString()This method returns a String that represent the objectvoidwriteObject(OutputSerializer out)This method serialize the object with the default level of detail, that removes private and hidden attributesvoidwriteObject(OutputSerializer out, DetailLevel level)SerializeMethods inherited from class marauroa.common.game.SlotOwner
addSlot, addSlot, deserializeRPSlots, fill, getSlot, hasSlot, removeSlot, serializeRPSlots, slots, slotsIterator, writeToJsonMethods inherited from class marauroa.common.game.Attributes
add, applyDifferences, clearVisible, get, getBool, getDouble, getInt, getList, getLong, getRPClass, has, instanceOf, isEmpty, iterator, put, put, put, put, put, readFromMap, remove, resetAddedAndDeletedAttributes, setAddedAttributes, setDeletedAttributes, setRPClass, setRPClass, size, toAttributeStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
RPEvent
Constructor- Parameters:
name- name of this RPEvent
-
RPEvent
public RPEvent()Constructor
-
-
Method Details
-
clone
This method create a copy of the slot- Overrides:
clonein classAttributes
-
fill
Copy constructor- Parameters:
event- the object that is going to be copied.
-
setOwner
Set the owner of this RPEvent.- Parameters:
owner-
-
getName
Return the name of the event- Returns:
- name of the event
-
writeObject
Description copied from class:AttributesThis method serialize the object with the default level of detail, that removes private and hidden attributes- Specified by:
writeObjectin interfaceSerializable- Overrides:
writeObjectin classAttributes- Parameters:
out- the output serializer- Throws:
IOException- in case of an IO-error
-
writeObject
Serialize- Overrides:
writeObjectin classAttributes- Parameters:
out- the output serializer.level- the detail level of the serialization- Throws:
IOException- in case of an IO error
-
readObject
Deserialize- Specified by:
readObjectin interfaceSerializable- Overrides:
readObjectin classAttributes- Parameters:
in- the input serializer- Throws:
IOException- in case of unexpected attributes
-
hashCode
public int hashCode()- Overrides:
hashCodein classAttributes
-
equals
Returns true if two objects are exactly equal- Overrides:
equalsin classAttributes- Parameters:
obj- the object to compare with this one.- Returns:
- true if they are equal, or false otherwise.
-
toString
Description copied from class:AttributesThis method returns a String that represent the object
-