Package dev.prozilla.pine.core.entity
Class EntityChunk
java.lang.Object
dev.prozilla.pine.core.entity.EntityChunk
- All Implemented Interfaces:
Printable
A wrapper for an entity and its components that match a system's query.
Provides quick access to the matching components of the entity.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
equals
(EntityChunk entityChunk) boolean
<C extends Component>
CgetComponent
(int index) Retrieves a component at a given index.<C extends Component>
CgetComponent
(Class<C> type) Retrieves a component of the specified type.boolean
isActive()
void
setComponent
(int index, Component component) Sets a component at the given index.void
setComponents
(Component[] components) Sets all components in this group.int
size()
Returns the amount of components in this match.toString()
Returns a string representation of this object.
-
Constructor Details
-
EntityChunk
-
-
Method Details
-
setComponents
Sets all components in this group.- Throws:
IllegalArgumentException
- If the components are not attached to the same entity.
-
setComponent
Sets a component at the given index.- Throws:
IllegalArgumentException
- If the component is not an instance of the right component class.
-
getComponent
Retrieves a component of the specified type.- Throws:
IllegalArgumentException
- If no component is found.
-
getComponent
Retrieves a component at a given index. -
getEntity
- Throws:
IllegalStateException
-
getTransform
-
isActive
public boolean isActive() -
checkStatus
public void checkStatus() -
size
public int size()Returns the amount of components in this match. -
equals
-
equals
-
toString
Description copied from interface:Printable
Returns a string representation of this object.
-