diff --git a/src/mudlib/entity.py b/src/mudlib/entity.py index cc94d97..ac26660 100644 --- a/src/mudlib/entity.py +++ b/src/mudlib/entity.py @@ -2,14 +2,20 @@ from dataclasses import dataclass, field +from mudlib.object import Object + @dataclass -class Entity: - """Base class for anything with position and identity in the world.""" +class Entity(Object): + """Base class for anything with position and identity in the world. - name: str - x: int - y: int + Inherits name, location from Object. Narrows x, y to int (entities + always have spatial coordinates). + """ + + # Entities always have spatial coordinates (override Object's int | None) + x: int = 0 + y: int = 0 # Combat stats pl: float = 100.0 # power level (health and damage multiplier) stamina: float = 100.0 # current stamina