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
-
Method Summary
Modifier and TypeMethodDescriptionclone()
This method create a copy of the slotboolean
Returns true if two objects are exactly equalvoid
Copy constructorgetName()
Return the name of the eventint
hashCode()
void
Deserializevoid
Set the owner of this RPEvent.toString()
This method returns a String that represent the objectvoid
writeObject(OutputSerializer out)
This method serialize the object with the default level of detail, that removes private and hidden attributesvoid
writeObject(OutputSerializer out, DetailLevel level)
SerializeMethods inherited from class marauroa.common.game.SlotOwner
addSlot, addSlot, deserializeRPSlots, fill, getSlot, hasSlot, removeSlot, serializeRPSlots, slots, slotsIterator, writeToJson
Methods 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, toAttributeString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
clone
in 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:Attributes
This method serialize the object with the default level of detail, that removes private and hidden attributes- Specified by:
writeObject
in interfaceSerializable
- Overrides:
writeObject
in classAttributes
- Parameters:
out
- the output serializer- Throws:
IOException
- in case of an IO-error
-
writeObject
Serialize- Overrides:
writeObject
in 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:
readObject
in interfaceSerializable
- Overrides:
readObject
in classAttributes
- Parameters:
in
- the input serializer- Throws:
IOException
- in case of unexpected attributes
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAttributes
-
equals
Returns true if two objects are exactly equal- Overrides:
equals
in classAttributes
- Parameters:
obj
- the object to compare with this one.- Returns:
- true if they are equal, or false otherwise.
-
toString
Description copied from class:Attributes
This method returns a String that represent the object
-