single property

T? single

Returns a single element of the components on the game.

Returns null if there is no component.

Implementation

T? get single {
  if (_components.isNotEmpty) {
    return _components.first;
  }
  return null;
}