Package tripleplay.entity
Class Component.IMask
java.lang.Object
tripleplay.entity.Component
tripleplay.entity.Component.IMask
- Enclosing class:
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearFlag
(int entityId, int flag) Clearsflag
from the mask forentityId
.int
get
(int entityId) Returns the value of this component forentityId
.boolean
isSet
(int entityId, int flag) Returns whetherflag
is set in this mask.void
set
(int entityId, int value) Updates the entire mask forentityId
.void
setAnd
(int entityId, int mask) Sets the mask forentityId
tocurrent & mask
.void
setFlag
(int entityId, int flag) Setsflag
in the mask forentityId
.void
setOr
(int entityId, int mask) Sets the mask forentityId
tocurrent | mask
.
-
Constructor Details
-
IMask
-
-
Method Details
-
get
public int get(int entityId) Returns the value of this component forentityId
. -
set
public void set(int entityId, int value) Updates the entire mask forentityId
. -
setAnd
public void setAnd(int entityId, int mask) Sets the mask forentityId
tocurrent & mask
. -
setOr
public void setOr(int entityId, int mask) Sets the mask forentityId
tocurrent | mask
. -
isSet
public boolean isSet(int entityId, int flag) Returns whetherflag
is set in this mask.- Parameters:
flag
- an integer with the appropriate flag bit set.
-
setFlag
public void setFlag(int entityId, int flag) Setsflag
in the mask forentityId
.- Parameters:
flag
- an integer with the appropriate flag bit set.
-
clearFlag
public void clearFlag(int entityId, int flag) Clearsflag
from the mask forentityId
.- Parameters:
flag
- an integer with the appropriate flag bit set.
-