16 lines
366 B
Python
16 lines
366 B
Python
"""Base entity class for characters in the world."""
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class Entity:
|
|
"""Base class for anything with position and identity in the world."""
|
|
|
|
name: str
|
|
x: int
|
|
y: int
|
|
|
|
async def send(self, message: str) -> None:
|
|
"""Send a message to this entity. Base implementation is a no-op."""
|
|
pass
|