blob: 463eabae3c930ff57b0b3c59757dc61dd807031c (
plain) (
tree)
eb23fc8 ^
from .generated import common_pb2 as common_pb2
from typing import TYPE_CHECKING, NamedTuple
if TYPE_CHECKING:
from . import Lingo2World
class PlayerLocation(NamedTuple):
code: int | None
class Lingo2PlayerLogic:
locations_by_room: dict[int, list[PlayerLocation]]
def __init__(self, world: "Lingo2World"):
self.locations_by_room = {}
for door in world.static_logic.objects.doors:
if door.type == common_pb2.DoorType.STANDARD:
self.locations_by_room.setdefault(door.room_id, []).append(PlayerLocation(door.ap_id))
|