levelz.coord ============ .. py:module:: levelz.coord Classes ------- .. autoapisummary:: levelz.coord.Dimension levelz.coord.Coordinate levelz.coord.Coordinate2D levelz.coord.Coordinate3D Module Contents --------------- .. py:class:: Dimension Bases: :py:obj:`enum.Enum` Represents a Game Dimension. .. py:attribute:: TWO :value: 2 Represents a 2D Plane. .. py:attribute:: THREE :value: 3 Represents a 3D Space. .. py:property:: is2D Returns True if the Dimension is 2D. .. py:property:: is3D Returns True if the Dimension is 3D. .. py:method:: __str__() .. py:method:: __eq__(other) .. py:class:: Coordinate Represents a Game Coordinate. .. py:property:: magnitude :abstractmethod: Return the magnitude of the coordinate. .. py:property:: dimension :abstractmethod: Return the dimension of the coordinate. .. py:class:: Coordinate2D(x: float, y: float) Bases: :py:obj:`Coordinate` Represents a 2-Dimensional Coordinate. .. py:attribute:: x :type: float :value: 0 The x-coordinate of the 2D Coordinate. .. py:attribute:: y :type: float :value: 0 The y-coordinate of the 2D Coordinate. .. py:property:: magnitude Return the magnitude of the coordinate. .. py:property:: dimension Return the dimension of the coordinate. .. py:method:: __str__() .. py:method:: __eq__(other) .. py:method:: from_string(s: str) :staticmethod: Parses a string to create a 2D Coordinate. :param str s: The string to parse. :return: The 2D Coordinate. :rtype: Coordinate2D .. py:class:: Coordinate3D(x: float, y: float, z: float) Bases: :py:obj:`Coordinate` Represents a 3-Dimensional Coordinate. .. py:attribute:: x :type: float :value: 0 The x-coordinate of the 3D Coordinate. .. py:attribute:: y :type: float :value: 0 The y-coordinate of the 3D Coordinate. .. py:attribute:: z :type: float :value: 0 The z-coordinate of the 3D Coordinate. .. py:property:: magnitude Return the magnitude of the coordinate. .. py:property:: dimension Return the dimension of the coordinate. .. py:method:: __str__() .. py:method:: __eq__(other) .. py:method:: from_string(s: str) :staticmethod: Parses a string to create a 3D Coordinate. :param str s: The string to parse. :return: The 3D Coordinate. :rtype: Coordiante3D