Package games.stendhal.client
Class PerceptionListenerImpl
java.lang.Object
games.stendhal.client.PerceptionListenerImpl
- All Implemented Interfaces:
IPerceptionListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanonAdded is called when an object is added to the world for first time or after a sync perception.booleanonClear()onClear is called when the whole world is going to be cleared.booleanonDeleted is called when an object is removed of the world Return true to stop further processing.voidonException(Exception exception, MessageS2CPerception perception) onException is called when an exception happensbooleanonModifiedAdded(RPObject object, RPObject changes) onModifiedAdded is called when an object is modified by adding or changing one of its attributes.booleanonModifiedDeleted(RPObject object, RPObject changes) onModifiedDeleted is called each time the object has one of its attributes removed.booleanonMyRPObject(RPObject added, RPObject deleted) onMyRPObject is called when our rpobject avatar is processed.voidonPerceptionBegin(byte type, int timestamp) onPerceptionBegin is called when the perception is going to be appliedvoidonPerceptionEnd(byte type, int timestamp) onPerceptionBegin is called when the perception has been appliedvoidonSynced()onSynced is called when the client recover syncvoidonUnsynced is called when the client lose sync
-
Constructor Details
-
PerceptionListenerImpl
public PerceptionListenerImpl()
-
-
Method Details
-
onAdded
Description copied from interface:IPerceptionListeneronAdded is called when an object is added to the world for first time or after a sync perception. Return true to stop further processing.- Specified by:
onAddedin interfaceIPerceptionListener- Parameters:
object- the added object.- Returns:
- true to stop further processing
-
onClear
public boolean onClear()Description copied from interface:IPerceptionListeneronClear is called when the whole world is going to be cleared. It happens on sync perceptions Return true to stop further processing.- Specified by:
onClearin interfaceIPerceptionListener- Returns:
- true to stop further processing
-
onDeleted
Description copied from interface:IPerceptionListeneronDeleted is called when an object is removed of the world Return true to stop further processing.- Specified by:
onDeletedin interfaceIPerceptionListener- Parameters:
object- the original object- Returns:
- true to stop further processing
-
onException
Description copied from interface:IPerceptionListeneronException is called when an exception happens- Specified by:
onExceptionin interfaceIPerceptionListener- Parameters:
exception- the exception that happened.perception- the message that causes the problem
-
onModifiedAdded
Description copied from interface:IPerceptionListeneronModifiedAdded is called when an object is modified by adding or changing one of its attributes. Return true to stop further processing. Note that the method is called *before* modifying the object.- Specified by:
onModifiedAddedin interfaceIPerceptionListener- Parameters:
object- the original objectchanges- the added and modified changes.- Returns:
- true to stop further processing
-
onModifiedDeleted
Description copied from interface:IPerceptionListeneronModifiedDeleted is called each time the object has one of its attributes removed. Return true to stop further processing. Note that the method is called *before* modifying the object.- Specified by:
onModifiedDeletedin interfaceIPerceptionListener- Parameters:
object- the original objectchanges- the deleted attributes.- Returns:
- true to stop further processing
-
onMyRPObject
Description copied from interface:IPerceptionListeneronMyRPObject is called when our rpobject avatar is processed. Return true to stop further processing.- Specified by:
onMyRPObjectin interfaceIPerceptionListener- Parameters:
added- the added and modified attributes and slotsdeleted- the deleted attributes- Returns:
- true to stop further processing
-
onPerceptionBegin
public void onPerceptionBegin(byte type, int timestamp) Description copied from interface:IPerceptionListeneronPerceptionBegin is called when the perception is going to be applied- Specified by:
onPerceptionBeginin interfaceIPerceptionListener- Parameters:
type- type of the perception: SYNC or DELTAtimestamp- the timestamp of the perception
-
onPerceptionEnd
public void onPerceptionEnd(byte type, int timestamp) Description copied from interface:IPerceptionListeneronPerceptionBegin is called when the perception has been applied- Specified by:
onPerceptionEndin interfaceIPerceptionListener- Parameters:
type- type of the perception: SYNC or DELTAtimestamp- the timestamp of the perception
-
onSynced
public void onSynced()Description copied from interface:IPerceptionListeneronSynced is called when the client recover sync- Specified by:
onSyncedin interfaceIPerceptionListener
-
onUnsynced
public void onUnsynced()Description copied from interface:IPerceptionListeneronUnsynced is called when the client lose sync- Specified by:
onUnsyncedin interfaceIPerceptionListener
-