aboutsummaryrefslogtreecommitdiff
path: root/kennel/engine/components/position.py
blob: 5c5b372c0e502a10462169f873fe630690dc8812 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 to_dict(self) -> dict:
        return {"x": self.x, "y": self.y}