from dataclasses import dataclass
from enum import Enum
class Mode(Enum):
ALMSIVI = 'Almsivi Intervention', 'invoke Almsivi Intervention', True, 0.25
BOAT = 'Boat', 'take the Boat', False, 0
CARAVAN = 'Caravan', 'use the Caravan', False, 0
DIVINE = 'Divine Intervention', 'invoke Divine Intervention', True, 0.25
FOOT = 'Foot', 'walk', False, 0.75
GUIDE = 'Guild Guide', 'take the Guild Guide', True, 0.5
PROPYLON = 'Propylon Index', 'travel by Propylon', True, 0.5
RECALL = 'Recall', 'recall', True, 0
RIVER_STRIDER = 'River Strider', 'take the River Strider', False, 0
SILT_STRIDER = 'Silt Strider', 'take the Silt Strider', False, 0
def __new__(cls, value, pretty, teleport, weight):
obj = object.__new__(cls)
obj._value_ = value
obj.pretty = pretty
obj.weight = weight
obj.teleport = teleport
return obj
def __str__(self) -> str:
return self.value
@dataclass(frozen=True)
class Place:
name: str
def __str__(self) -> str:
return self.name
@dataclass(frozen=True)
class Connection:
origin: Place
destination: Place
mode: Mode
time: int
def __str__(self) -> str:
time = 'instantaneous'
if self.time > 0:
time = f'{self.time} {"hour" if self.time == 1 else "hours"}'
return f'{self.origin} -> {self.destination} ({self.mode}, {time})'