Interface IPerceptionListener

All Known Implementing Classes:
PerceptionListenerImpl

public interface IPerceptionListener
The IPerceptionListener interface provides methods that are called while applying the perception
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    onAdded​(RPObject object)
    onAdded is called when an object is added to the world for first time or after a sync perception.
    boolean
    onClear is called when the whole world is going to be cleared.
    boolean
    onDeleted​(RPObject object)
    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 happens
    boolean
    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 applied
    void
    onPerceptionEnd​(byte type, int timestamp)
    onPerceptionBegin is called when the perception has been applied
    void
    onSynced is called when the client recover sync
    void
    onUnsynced is called when the client lose sync
  • Method Details

    • onAdded

      boolean onAdded(RPObject object)
      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.
      Parameters:
      object - the added object.
      Returns:
      true to stop further processing
    • onModifiedAdded

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

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

      boolean onDeleted(RPObject object)
      onDeleted is called when an object is removed of the world Return true to stop further processing.
      Parameters:
      object - the original object
      Returns:
      true to stop further processing
    • onMyRPObject

      boolean onMyRPObject(RPObject added, RPObject deleted)
      onMyRPObject is called when our rpobject avatar is processed. Return true to stop further processing.
      Parameters:
      added - the added and modified attributes and slots
      deleted - the deleted attributes
      Returns:
      true to stop further processing
    • onClear

      boolean onClear()
      onClear is called when the whole world is going to be cleared. It happens on sync perceptions Return true to stop further processing.
      Returns:
      true to stop further processing
    • onSynced

      void onSynced()
      onSynced is called when the client recover sync
    • onUnsynced

      void onUnsynced()
      onUnsynced is called when the client lose sync
    • onPerceptionBegin

      void onPerceptionBegin(byte type, int timestamp)
      onPerceptionBegin is called when the perception is going to be applied
      Parameters:
      type - type of the perception: SYNC or DELTA
      timestamp - the timestamp of the perception
    • onPerceptionEnd

      void onPerceptionEnd(byte type, int timestamp)
      onPerceptionBegin is called when the perception has been applied
      Parameters:
      type - type of the perception: SYNC or DELTA
      timestamp - the timestamp of the perception
    • onException

      void onException(Exception exception, MessageS2CPerception perception)
      onException is called when an exception happens
      Parameters:
      exception - the exception that happened.
      perception - the message that causes the problem