Package games.stendhal.client
Class PerceptionListenerImpl
java.lang.Object
games.stendhal.client.PerceptionListenerImpl
- All Implemented Interfaces:
IPerceptionListener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
onAdded is called when an object is added to the world for first time or after a sync perception.boolean
onClear()
onClear is called when the whole world is going to be cleared.boolean
onDeleted is called when an object is removed of the world Return true to stop further processing.void
onException(Exception exception, MessageS2CPerception perception)
onException is called when an exception happensboolean
onModifiedAdded(RPObject object, RPObject changes)
onModifiedAdded is called when an object is modified by adding or changing one of its attributes.boolean
onModifiedDeleted(RPObject object, RPObject changes)
onModifiedDeleted is called each time the object has one of its attributes removed.boolean
onMyRPObject(RPObject added, RPObject deleted)
onMyRPObject is called when our rpobject avatar is processed.void
onPerceptionBegin(byte type, int timestamp)
onPerceptionBegin is called when the perception is going to be appliedvoid
onPerceptionEnd(byte type, int timestamp)
onPerceptionBegin is called when the perception has been appliedvoid
onSynced()
onSynced is called when the client recover syncvoid
onUnsynced is called when the client lose sync
-
Constructor Details
-
PerceptionListenerImpl
public PerceptionListenerImpl()
-
-
Method Details
-
onAdded
Description copied from interface:IPerceptionListener
onAdded 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:
onAdded
in interfaceIPerceptionListener
- Parameters:
object
- the added object.- Returns:
- true to stop further processing
-
onClear
public boolean onClear()Description copied from interface:IPerceptionListener
onClear is called when the whole world is going to be cleared. It happens on sync perceptions Return true to stop further processing.- Specified by:
onClear
in interfaceIPerceptionListener
- Returns:
- true to stop further processing
-
onDeleted
Description copied from interface:IPerceptionListener
onDeleted is called when an object is removed of the world Return true to stop further processing.- Specified by:
onDeleted
in interfaceIPerceptionListener
- Parameters:
object
- the original object- Returns:
- true to stop further processing
-
onException
Description copied from interface:IPerceptionListener
onException is called when an exception happens- Specified by:
onException
in interfaceIPerceptionListener
- Parameters:
exception
- the exception that happened.perception
- the message that causes the problem
-
onModifiedAdded
Description copied from interface:IPerceptionListener
onModifiedAdded 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:
onModifiedAdded
in interfaceIPerceptionListener
- Parameters:
object
- the original objectchanges
- the added and modified changes.- Returns:
- true to stop further processing
-
onModifiedDeleted
Description copied from interface:IPerceptionListener
onModifiedDeleted 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:
onModifiedDeleted
in interfaceIPerceptionListener
- Parameters:
object
- the original objectchanges
- the deleted attributes.- Returns:
- true to stop further processing
-
onMyRPObject
Description copied from interface:IPerceptionListener
onMyRPObject is called when our rpobject avatar is processed. Return true to stop further processing.- Specified by:
onMyRPObject
in 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:IPerceptionListener
onPerceptionBegin is called when the perception is going to be applied- Specified by:
onPerceptionBegin
in 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:IPerceptionListener
onPerceptionBegin is called when the perception has been applied- Specified by:
onPerceptionEnd
in interfaceIPerceptionListener
- Parameters:
type
- type of the perception: SYNC or DELTAtimestamp
- the timestamp of the perception
-
onSynced
public void onSynced()Description copied from interface:IPerceptionListener
onSynced is called when the client recover sync- Specified by:
onSynced
in interfaceIPerceptionListener
-
onUnsynced
public void onUnsynced()Description copied from interface:IPerceptionListener
onUnsynced is called when the client lose sync- Specified by:
onUnsynced
in interfaceIPerceptionListener
-