getComponent<T extends Component> method
Returns the component of type T
for the given entity
.
Implementation
T? getComponent<T extends Component>(
int entity,
ComponentType componentType,
) {
final index = componentType._bitIndex;
final components = _componentInfoByType[index];
if (components != null && entity < components.components.length) {
return components.components[entity] as T?;
}
return null;
}