eight_way_directional

class EightWayDirectionalMixin(name: str, similar_entities: list[str], tile_position: list | dict = [0, 0], **kwargs: dict)

Allows the Entity to be rotated in the 8 cardinal directions and diagonals. Sets the rotatable attribute to True.

See also

DirectionalMixin

property direction: Direction

The direction that the Entity is facing. An Entity’s “front” is usually the direction of it’s outputs, if it has any.

Note that for rail entities, what “direction” means to them is not entirely intuitive, especially in the diagonal directions. Proceed with caution.

Getter:

Gets the direction that the Entity is facing.

Setter:

Sets the direction of the Entity. Defaults to Direction.NORTH if set to None.

Type:

Direction

Raises:
  • DraftsmanError – If the direction is set while inside an Collection, which is forbidden.

  • ValueError – If set to anything other than a Direction, or its equivalent int.