mud/src/mudlib/portal.py
Jared Miller 303ce2c89e
Add Portal class with target zone and coordinates
Portals are non-portable Things that exist in zones and define
transitions to other zones via target coordinates.
2026-02-11 20:38:47 -05:00

25 lines
572 B
Python

"""Portal — a transition point between zones."""
from __future__ import annotations
from dataclasses import dataclass
from mudlib.thing import Thing
@dataclass
class Portal(Thing):
"""A portal connecting zones.
Portals are non-portable Things that exist in zones and define
transitions to other zones via target coordinates.
"""
target_zone: str = ""
target_x: int = 0
target_y: int = 0
def __post_init__(self) -> None:
"""Force portals to be non-portable."""
self.portable = False
super().__post_init__()