diff --git a/src/mudlib/thing.py b/src/mudlib/thing.py index 54cca75..6336f5f 100644 --- a/src/mudlib/thing.py +++ b/src/mudlib/thing.py @@ -20,3 +20,4 @@ class Thing(Object): portable: bool = True aliases: list[str] = field(default_factory=list) readable_text: str = "" + tags: list[str] = field(default_factory=list) diff --git a/src/mudlib/things.py b/src/mudlib/things.py index 6c81771..5ea25b8 100644 --- a/src/mudlib/things.py +++ b/src/mudlib/things.py @@ -30,6 +30,7 @@ class ThingTemplate: # Verb handlers (verb_name -> module:function reference) verbs: dict[str, str] = field(default_factory=dict) readable_text: str = "" + tags: list[str] = field(default_factory=list) # Module-level registry @@ -61,6 +62,7 @@ def load_thing_template(path: Path) -> ThingTemplate: locked=data.get("locked", False), verbs=data.get("verbs", {}), readable_text=data.get("readable_text", ""), + tags=data.get("tags", []), ) @@ -89,6 +91,7 @@ def spawn_thing( portable=template.portable, aliases=list(template.aliases), readable_text=template.readable_text, + tags=list(template.tags), capacity=template.capacity, closed=template.closed, locked=template.locked, @@ -103,6 +106,7 @@ def spawn_thing( portable=template.portable, aliases=list(template.aliases), readable_text=template.readable_text, + tags=list(template.tags), location=location, x=x, y=y,