levelz.coord¶
Classes¶
Represents a Game Dimension. |
|
Represents a Game Coordinate. |
|
Represents a 2-Dimensional Coordinate. |
|
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__()¶
- __eq__(other)¶
- 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__()¶
- __eq__(other)¶
- 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:
- 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__()¶
- __eq__(other)¶
- 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