mud/src/mudlib/thing.py
Jared Miller 4205b174c9
Add item tags to Thing model
Tags enable categorizing items for boundary checks and other systems.
Added tags field to Thing and ThingTemplate, updated load and spawn
functions to handle tags from TOML definitions.
2026-02-14 12:39:48 -05:00

23 lines
621 B
Python

"""Thing — an item that can exist in zones or inventories."""
from __future__ import annotations
from dataclasses import dataclass, field
from mudlib.object import Object
@dataclass(eq=False)
class Thing(Object):
"""An item in the world.
Things can be on the ground (location=zone, with x/y) or carried
by an entity (location=entity, no x/y). The portable flag controls
whether entities can pick them up.
"""
description: str = ""
portable: bool = True
aliases: list[str] = field(default_factory=list)
readable_text: str = ""
tags: list[str] = field(default_factory=list)