Package tripleplay.entity
Class System
java.lang.Object
tripleplay.entity.System
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 ClassesModifier and TypeClassDescriptionstatic interface
Provides a way to iterate over this system's active entities. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Returns the number of active entities in this system.final int
entityId
(int ii) Returns the id of theii
th active entity in this system.void
setEnabled
(boolean enabled) Enables or disables this system.
-
Field Details
-
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 theii
th active entity in this system.
-