levelz.coord

Classes

Dimension

Represents a Game Dimension.

Coordinate

Represents a Game Coordinate.

Coordinate2D

Represents a 2-Dimensional Coordinate.

Coordinate3D

Represents a 3-Dimensional Coordinate.

Module Contents

class levelz.coord.Dimension

Bases: enum.Enum

Represents a Game Dimension.

TWO = 2

Represents a 2D Plane.

THREE = 3

Represents a 3D Space.

property is2D
Returns True if the Dimension is 2D.
property is3D
Returns True if the Dimension is 3D.
__str__()

Return str(self).

__eq__(other)

Return self==value.

class levelz.coord.Coordinate

Represents a Game Coordinate.

abstract property magnitude

Return the magnitude of the coordinate.

abstract property dimension

Return the dimension of the coordinate.

class levelz.coord.Coordinate2D(x: float, y: float)

Bases: Coordinate

Represents a 2-Dimensional Coordinate.

x: float = 0

The x-coordinate of the 2D Coordinate.

y: float = 0

The y-coordinate of the 2D Coordinate.

property magnitude
Return the magnitude of the coordinate.
property dimension
Return the dimension of the coordinate.
__str__()

Return str(self).

__eq__(other)

Return self==value.

static from_string(s: str)

Parses a string to create a 2D Coordinate.

Parameters:

s (str) – The string to parse.

Returns:

The 2D Coordinate.

Return type:

Coordinate2D

class levelz.coord.Coordinate3D(x: float, y: float, z: float)

Bases: Coordinate

Represents a 3-Dimensional Coordinate.

x: float = 0

The x-coordinate of the 3D Coordinate.

y: float = 0

The y-coordinate of the 3D Coordinate.

z: float = 0

The z-coordinate of the 3D Coordinate.

property magnitude
Return the magnitude of the coordinate.
property dimension
Return the dimension of the coordinate.
__str__()

Return str(self).

__eq__(other)

Return self==value.

static from_string(s: str)

Parses a string to create a 3D Coordinate.

Parameters:

s (str) – The string to parse.

Returns:

The 3D Coordinate.

Return type:

Coordiante3D