15 lines
362 B
Python
15 lines
362 B
Python
from .component import Component, ComponentType
|
|
|
|
|
|
class Position(Component):
|
|
def __init__(self, x: float, y: float):
|
|
super().__init__(ComponentType.POSITION)
|
|
self.x = x
|
|
self.y = y
|
|
|
|
def __repr__(self) -> str:
|
|
return f"Position(x={self.x}, y={self.y})"
|
|
|
|
def dict(self) -> dict:
|
|
return {"x": self.x, "y": self.y}
|