Portals are non-portable Things that exist in zones and define transitions to other zones via target coordinates.
25 lines
572 B
Python
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__()
|