summary refs log tree commit diff stats
path: root/datatypes.py
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-03-15 04:26:00 -0400
committerGitHub <noreply@github.com>2024-03-15 09:26:00 +0100
commite016228d2b76fa367889c9d98d6eb9e783f98cb4 (patch)
tree5c4fd5427ee1c89a832b3327eef6d39d4ce82d82 /datatypes.py
parentfcb3b36f44a7d475aa49c5c44971a2b7cabc4ca8 (diff)
downloadlingo-apworld-e016228d2b76fa367889c9d98d6eb9e783f98cb4.tar.gz
lingo-apworld-e016228d2b76fa367889c9d98d6eb9e783f98cb4.tar.bz2
lingo-apworld-e016228d2b76fa367889c9d98d6eb9e783f98cb4.zip
Lingo: Pre-compile datafile to improve loading time (#2829)
Diffstat (limited to 'datatypes.py')
-rw-r--r--datatypes.py67
1 files changed, 67 insertions, 0 deletions
diff --git a/datatypes.py b/datatypes.py new file mode 100644 index 0000000..eb5c879 --- /dev/null +++ b/datatypes.py
@@ -0,0 +1,67 @@
1from typing import List, NamedTuple, Optional
2
3
4class RoomAndDoor(NamedTuple):
5 room: Optional[str]
6 door: str
7
8
9class RoomAndPanel(NamedTuple):
10 room: Optional[str]
11 panel: str
12
13
14class RoomEntrance(NamedTuple):
15 room: str # source room
16 door: Optional[RoomAndDoor]
17 painting: bool
18
19
20class Room(NamedTuple):
21 name: str
22 entrances: List[RoomEntrance]
23
24
25class Door(NamedTuple):
26 name: str
27 item_name: str
28 location_name: Optional[str]
29 panels: Optional[List[RoomAndPanel]]
30 skip_location: bool
31 skip_item: bool
32 has_doors: bool
33 painting_ids: List[str]
34 event: bool
35 group: Optional[str]
36 include_reduce: bool
37 junk_item: bool
38
39
40class Panel(NamedTuple):
41 required_rooms: List[str]
42 required_doors: List[RoomAndDoor]
43 required_panels: List[RoomAndPanel]
44 colors: List[str]
45 check: bool
46 event: bool
47 exclude_reduce: bool
48 achievement: bool
49 non_counting: bool
50
51
52class Painting(NamedTuple):
53 id: str
54 room: str
55 enter_only: bool
56 exit_only: bool
57 required: bool
58 required_when_no_doors: bool
59 required_door: Optional[RoomAndDoor]
60 disable: bool
61 req_blocked: bool
62 req_blocked_when_no_doors: bool
63
64
65class Progression(NamedTuple):
66 item_name: str
67 index: int