def set_entity(self, entity: "EntityWithComponents") -> None:
    """Sets the entity that this component belongs to.

    Args:
      entity: The entity that this component belongs to.

    Raises:
      RuntimeError: If the entity is already set.
    """
    if self._entity is not None:
      raise RuntimeError("Entity is already set.")
    self._entity = entity
Sets the entity that this component belongs to.

    Args:
      entity: The entity that this component belongs to.

    Raises:
      RuntimeError: If the entity is already set.
    
concordia/typing/entity_component.py