Class Component.IMask

java.lang.Object
tripleplay.entity.Component
tripleplay.entity.Component.IMask
Enclosing class:
Component

public static final class Component.IMask extends Component
A component implementation for a single int bit mask.
  • Nested Class Summary

    Nested classes/interfaces inherited from class tripleplay.entity.Component

    Component.FScalar, Component.Generic<T>, Component.IMask, Component.IScalar, Component.XY
  • Field Summary

    Fields inherited from class tripleplay.entity.Component

    world
  • Constructor Summary

    Constructors
    Constructor
    Description
    IMask(World world)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clearFlag(int entityId, int flag)
    Clears flag from the mask for entityId.
    int
    get(int entityId)
    Returns the value of this component for entityId.
    boolean
    isSet(int entityId, int flag)
    Returns whether flag is set in this mask.
    void
    set(int entityId, int value)
    Updates the entire mask for entityId.
    void
    setAnd(int entityId, int mask)
    Sets the mask for entityId to current & mask.
    void
    setFlag(int entityId, int flag)
    Sets flag in the mask for entityId.
    void
    setOr(int entityId, int mask)
    Sets the mask for entityId to current | mask.

    Methods inherited from class tripleplay.entity.Component

    toString

    Methods inherited from class java.lang.Object

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

    • IMask

      public IMask(World world)
  • Method Details

    • get

      public int get(int entityId)
      Returns the value of this component for entityId.
    • set

      public void set(int entityId, int value)
      Updates the entire mask for entityId.
    • setAnd

      public void setAnd(int entityId, int mask)
      Sets the mask for entityId to current & mask.
    • setOr

      public void setOr(int entityId, int mask)
      Sets the mask for entityId to current | mask.
    • isSet

      public boolean isSet(int entityId, int flag)
      Returns whether flag is set in this mask.
      Parameters:
      flag - an integer with the appropriate flag bit set.
    • setFlag

      public void setFlag(int entityId, int flag)
      Sets flag in the mask for entityId.
      Parameters:
      flag - an integer with the appropriate flag bit set.
    • clearFlag

      public void clearFlag(int entityId, int flag)
      Clears flag from the mask for entityId.
      Parameters:
      flag - an integer with the appropriate flag bit set.