Class Component

java.lang.Object
tripleplay.entity.Component
Direct Known Subclasses:
Component.FScalar, Component.Generic, Component.IMask, Component.IScalar, Component.XY

public abstract class Component extends Object
A component contains the data for a single aspect of an entity. This might be its position in a 2D space, or its animation state, or any other piece of data that evolves as the entity exists in the world.

A Component instance contains the data for all entities that possess the component in question (in a sparse array). This enables a data-driven approach to entity processing where a system can process one or more components for its active entities with a cache-friendly memory access pattern.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A component implementation for a single scalar float.
    static final class 
    A component implementation for arbitrary objects.
    static final class 
    A component implementation for a single int bit mask.
    static final class 
    A component implementation for a single scalar int.
    static final class 
    A component implementation for a pair of floats.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final World
    The world in which this component exists.
  • Method Summary

    Modifier and Type
    Method
    Description
     

    Methods inherited from class java.lang.Object

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

    • world

      public final World world
      The world in which this component exists.
  • Method Details