campy.util.direction module

An enumerated type Direction whose elements are the four cardinal directions: NORTH, SOUTH, EAST, and WEST.

A Direction knows what Direction is to the left, the right, or opposite itself using the methods left(), right(), and opposite().

Usage:

direction = Direction.NORTH
direction.left()      # => Direction.WEST
direction.right()     # => Direction.EAST
direction.opposite()  # => Direction.SOUTH
class campy.util.direction.Direction[source]

Bases: enum.Enum

Represent the four compass directions.

EAST = 1
NORTH = 0
SOUTH = 2
WEST = 3
left()[source]

Return the direction to the left.

opposite()[source]

Return the opposite direction.

right()[source]

Return the direction to the right.