Interface EntityListInterface

All Known Implementing Classes:
AlienArmyArray, EntityListArray

public interface EntityListInterface
  • Method Details

    • clear

      void clear()
      Clear the list
    • add

      void add(Entity e)
      Add an entity
      Parameters:
      e - The entity to be added
    • increaseSpeed

      void increaseSpeed(int percentIncr)
      Increase the speed of all members of this list by a certain percentage
      Parameters:
      percentIncr -
    • registerEntityForRemoval

      void registerEntityForRemoval(Entity e)
      Registers an entity for removal next time the state of the list is updated
      Parameters:
      e - The entity to register for removal next time the upDateState is called on the list
    • updateState

      void updateState(long delta)
      Move all entities in the list according to time passed delta.
      Parameters:
      delta - Time passed since last updateState (ms)
    • draw

      void draw(Graphics2D g)
      draw all entities in the list
      Parameters:
      g - The graphics context to draw to
    • moveAndDraw

      void moveAndDraw(long delta, Graphics2D g)
      Move and draw
      Parameters:
      delta - Time passed since last updateState (ms)
      g - The graphics context to draw to
    • collidesWith

      Entity collidesWith(Entity other)
      Check if this entity collides with any entity in this entity list.
      Parameters:
      other - The entity to check collision against
      Returns:
      null if there is no collision, the entity if there is a collision
    • addEntityEventListener

      void addEntityEventListener(EntityEventListener l)
      Manage event listener registration
      Parameters:
      l - the listener to add
    • remove

      void remove(Entity e)
      Remove an entity from the list
      Parameters:
      e - The entity to remove
    • getNumEntities

      int getNumEntities()
      Number of entities
      Returns:
      The number of entities
    • getRandom

      Entity getRandom()
      return one of the entities in the list - choosing it randomly If there are no entities in the list will return null
      Returns: