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 TypeMethodDescriptionvoidvoiddestroy()Destroys the entity.booleanequals(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.inthashCode()booleanisActive()voidsetComponent(int index, Component component) Sets a component at the given index.voidsetComponents(Component[] components) Sets all components in this group.intsize()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. -
destroy
public void destroy()Destroys the entity. -
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
-
hashCode
public int hashCode() -
toString
Description copied from interface:PrintableReturns a string representation of this object.
-