17 lines
374 B
Python
17 lines
374 B
Python
"""Base entity: position, name, color. Everything visible on the map derives."""
|
|
|
|
from __future__ import annotations
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(slots=True)
|
|
class Entity:
|
|
x: int = 0
|
|
y: int = 0
|
|
name: str = ""
|
|
color: tuple[int, int, int] = (255, 255, 255)
|
|
|
|
@property
|
|
def pos(self) -> tuple[int, int]:
|
|
return (self.x, self.y)
|