Class GameObjects

java.lang.Object
games.stendhal.client.GameObjects
All Implemented Interfaces:
RPObjectChangeListener, Iterable<IEntity>

public class GameObjects extends Object implements RPObjectChangeListener, Iterable<IEntity>
stores the objects that exists on the World right now.
  • Method Details

    • createInstance

      public static GameObjects createInstance(StaticGameLayers collisionMap)
      Parameters:
      collisionMap - =layers that make floor and building
      Returns:
      singleton instance of GameOjects
    • getInstance

      public static GameObjects getInstance()
      Returns:
      existing instance of GameObjects
    • addGameObjectListener

      public void addGameObjectListener(GameObjects.GameObjectListener listener)
      Add a new game GameObjectListener.
      Parameters:
      listener -
    • removeGameObjectListener

      public void removeGameObjectListener(GameObjects.GameObjectListener listener)
      Remove a GameObjectListener.
      Parameters:
      listener -
    • iterator

      public Iterator<IEntity> iterator()
      Specified by:
      iterator in interface Iterable<IEntity>
    • get

      public IEntity get(RPObject object)
    • get

      public IEntity get(RPObject.ID id)
    • collides

      public boolean collides(IEntity entity)
    • update

      public void update(int delta)
      Update objects based on the lapsus of time ellapsed since the last call.
      Parameters:
      delta - The time since last update (in ms).
    • onAdded

      public void onAdded(RPObject object)
      An object was added.
      Specified by:
      onAdded in interface RPObjectChangeListener
      Parameters:
      object - The object.
    • onChangedAdded

      public void onChangedAdded(RPObject object, RPObject changes)
      The object added/changed attribute(s).
      Specified by:
      onChangedAdded in interface RPObjectChangeListener
      Parameters:
      object - The base object.
      changes - The changes.
    • onChangedRemoved

      public void onChangedRemoved(RPObject object, RPObject changes)
      An object removed attribute(s).
      Specified by:
      onChangedRemoved in interface RPObjectChangeListener
      Parameters:
      object - The base object.
      changes - The changes.
    • onRemoved

      public void onRemoved(RPObject object)
      An object was removed.
      Specified by:
      onRemoved in interface RPObjectChangeListener
      Parameters:
      object - The object.
    • onSlotAdded

      public void onSlotAdded(RPObject object, String slotName, RPObject sobject)
      A slot object was added.
      Specified by:
      onSlotAdded in interface RPObjectChangeListener
      Parameters:
      object - The container object.
      slotName - The slot name.
      sobject - The slot object.
    • onSlotChangedAdded

      public void onSlotChangedAdded(RPObject object, String slotName, RPObject sobject, RPObject schanges)
      A slot object added/changed attribute(s).
      Specified by:
      onSlotChangedAdded in interface RPObjectChangeListener
      Parameters:
      object - The base container object.
      slotName - The container's slot name.
      sobject - The slot object.
      schanges - The slot object changes.
    • onSlotChangedRemoved

      public void onSlotChangedRemoved(RPObject object, String slotName, RPObject sobject, RPObject schanges)
      A slot object removed attribute(s).
      Specified by:
      onSlotChangedRemoved in interface RPObjectChangeListener
      Parameters:
      object - The base container object.
      slotName - The container's slot name.
      sobject - The slot object.
      schanges - The slot object changes.
    • onSlotRemoved

      public void onSlotRemoved(RPObject object, String slotName, RPObject sobject)
      A slot object was removed.
      Specified by:
      onSlotRemoved in interface RPObjectChangeListener
      Parameters:
      object - The container object.
      slotName - The slot name.
      sobject - The slot object.