Class System

java.lang.Object
tripleplay.entity.System

public abstract class System extends Object
Handles a single concern in an entity-based game. That might be processing collisions, or updating entity's logical positions, or regenerating health, etc. A system operates on all entities which meet its criteria on a given tick. See isInterested(tripleplay.entity.Entity) for an explanation of how to choose which entities on which to operate.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Provides a way to iterate over this system's active entities.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final World
    The world of which this system is a part.
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    Returns the number of active entities in this system.
    final int
    entityId(int ii)
    Returns the id of the iith active entity in this system.
    void
    setEnabled(boolean enabled)
    Enables or disables this system.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • world

      public final World world
      The world of which this system is a part.
  • Method Details

    • setEnabled

      public void setEnabled(boolean enabled)
      Enables or disables this system. When a system is disabled, it will not be processed every frame. However, it will still be checked for entity interest and be notified when entities are added to and removed from its active set.
    • entityCount

      public final int entityCount()
      Returns the number of active entities in this system.
    • entityId

      public final int entityId(int ii)
      Returns the id of the iith active entity in this system.