Class PerceptionListenerImpl

java.lang.Object
games.stendhal.client.PerceptionListenerImpl
All Implemented Interfaces:
IPerceptionListener

public abstract class PerceptionListenerImpl extends Object implements IPerceptionListener
  • Constructor Details

    • PerceptionListenerImpl

      public PerceptionListenerImpl()
  • Method Details

    • onAdded

      public boolean onAdded(RPObject object)
      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 interface IPerceptionListener
      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 interface IPerceptionListener
      Returns:
      true to stop further processing
    • onDeleted

      public boolean onDeleted(RPObject object)
      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 interface IPerceptionListener
      Parameters:
      object - the original object
      Returns:
      true to stop further processing
    • onException

      public void onException(Exception exception, MessageS2CPerception perception)
      Description copied from interface: IPerceptionListener
      onException is called when an exception happens
      Specified by:
      onException in interface IPerceptionListener
      Parameters:
      exception - the exception that happened.
      perception - the message that causes the problem
    • onModifiedAdded

      public boolean onModifiedAdded(RPObject object, RPObject changes)
      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 interface IPerceptionListener
      Parameters:
      object - the original object
      changes - the added and modified changes.
      Returns:
      true to stop further processing
    • onModifiedDeleted

      public boolean onModifiedDeleted(RPObject object, RPObject changes)
      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 interface IPerceptionListener
      Parameters:
      object - the original object
      changes - the deleted attributes.
      Returns:
      true to stop further processing
    • onMyRPObject

      public boolean onMyRPObject(RPObject added, RPObject deleted)
      Description copied from interface: IPerceptionListener
      onMyRPObject is called when our rpobject avatar is processed. Return true to stop further processing.
      Specified by:
      onMyRPObject in interface IPerceptionListener
      Parameters:
      added - the added and modified attributes and slots
      deleted - 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 interface IPerceptionListener
      Parameters:
      type - type of the perception: SYNC or DELTA
      timestamp - 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 interface IPerceptionListener
      Parameters:
      type - type of the perception: SYNC or DELTA
      timestamp - 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 interface IPerceptionListener
    • onUnsynced

      public void onUnsynced()
      Description copied from interface: IPerceptionListener
      onUnsynced is called when the client lose sync
      Specified by:
      onUnsynced in interface IPerceptionListener