getSafe method

T? getSafe(
  1. int entity
)

Fast and safe retrieval of a component for this entity. If the entity does not have this component then null is returned.

Implementation

T? getSafe(int entity) {
  if (_components.length > entity) {
    return _components[entity];
  }
  return null;
}