dungeoncoder 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dungeoncoder/__init__.py +4 -0
- dungeoncoder/__main__.py +254 -0
- dungeoncoder/_api_config.py +6 -0
- dungeoncoder/_generated/__init__.py +8 -0
- dungeoncoder/_generated/api/__init__.py +1 -0
- dungeoncoder/_generated/api/game/__init__.py +1 -0
- dungeoncoder/_generated/api/game/get_statistics.py +158 -0
- dungeoncoder/_generated/api/game/get_version.py +166 -0
- dungeoncoder/_generated/api/hero/__init__.py +1 -0
- dungeoncoder/_generated/api/hero/ask_oracle.py +192 -0
- dungeoncoder/_generated/api/hero/configure.py +207 -0
- dungeoncoder/_generated/api/hero/drop.py +207 -0
- dungeoncoder/_generated/api/hero/get_inventory.py +188 -0
- dungeoncoder/_generated/api/hero/get_items_at_position.py +188 -0
- dungeoncoder/_generated/api/hero/interact.py +188 -0
- dungeoncoder/_generated/api/hero/is_abyss_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/is_at_goal.py +192 -0
- dungeoncoder/_generated/api/hero/is_collision_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/is_enemy_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/is_facing_north.py +188 -0
- dungeoncoder/_generated/api/hero/is_switch_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/is_torch_in_front.py +188 -0
- dungeoncoder/_generated/api/hero/move.py +188 -0
- dungeoncoder/_generated/api/hero/peek_item_value.py +211 -0
- dungeoncoder/_generated/api/hero/pickup.py +207 -0
- dungeoncoder/_generated/api/hero/read_item_value.py +188 -0
- dungeoncoder/_generated/api/hero/sense_goal.py +192 -0
- dungeoncoder/_generated/api/hero/set_pace.py +207 -0
- dungeoncoder/_generated/api/hero/turn_left.py +188 -0
- dungeoncoder/_generated/api/level/__init__.py +1 -0
- dungeoncoder/_generated/api/level/load_level.py +190 -0
- dungeoncoder/_generated/api/level/reset_level.py +158 -0
- dungeoncoder/_generated/client.py +271 -0
- dungeoncoder/_generated/errors.py +14 -0
- dungeoncoder/_generated/models/__init__.py +47 -0
- dungeoncoder/_generated/models/api_error_response.py +98 -0
- dungeoncoder/_generated/models/api_error_response_status.py +7 -0
- dungeoncoder/_generated/models/boolean_result.py +96 -0
- dungeoncoder/_generated/models/boolean_result_status.py +7 -0
- dungeoncoder/_generated/models/configure_params.py +84 -0
- dungeoncoder/_generated/models/distance_param.py +76 -0
- dungeoncoder/_generated/models/name_param.py +76 -0
- dungeoncoder/_generated/models/nullable_integer_result.py +104 -0
- dungeoncoder/_generated/models/nullable_integer_result_status.py +7 -0
- dungeoncoder/_generated/models/nullable_string_result.py +104 -0
- dungeoncoder/_generated/models/nullable_string_result_status.py +7 -0
- dungeoncoder/_generated/models/pace_params.py +76 -0
- dungeoncoder/_generated/models/statistics.py +217 -0
- dungeoncoder/_generated/models/statistics_result.py +104 -0
- dungeoncoder/_generated/models/statistics_result_status.py +7 -0
- dungeoncoder/_generated/models/string_array_result.py +100 -0
- dungeoncoder/_generated/models/string_array_result_status.py +7 -0
- dungeoncoder/_generated/models/tiled_level.py +67 -0
- dungeoncoder/_generated/models/version_result.py +104 -0
- dungeoncoder/_generated/models/version_result_result.py +84 -0
- dungeoncoder/_generated/models/version_result_status.py +7 -0
- dungeoncoder/_generated/types.py +53 -0
- dungeoncoder/asciimap.py +824 -0
- dungeoncoder/dungeoncoder.py +482 -0
- dungeoncoder/generator.py +213 -0
- dungeoncoder/packs/gelaende.json +1 -0
- dungeoncoder/packs/items.json +67 -0
- dungeoncoder/packs/station.json +1 -0
- dungeoncoder/packs/studio.json +1 -0
- dungeoncoder/packs/tilesets.json +1 -0
- dungeoncoder/packs/werkstatt.json +1 -0
- dungeoncoder/replay.py +80 -0
- dungeoncoder/requirements.txt +2 -0
- dungeoncoder/sim.py +792 -0
- dungeoncoder/testing.py +63 -0
- dungeoncoder/trace.py +92 -0
- dungeoncoder/variants.py +112 -0
- dungeoncoder-0.2.0.dist-info/METADATA +37 -0
- dungeoncoder-0.2.0.dist-info/RECORD +77 -0
- dungeoncoder-0.2.0.dist-info/WHEEL +5 -0
- dungeoncoder-0.2.0.dist-info/licenses/LICENSE.txt +25 -0
- dungeoncoder-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..types import UNSET, Unset
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="Statistics")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class Statistics:
|
|
25
|
+
""" Counters since the level was (re)loaded.
|
|
26
|
+
|
|
27
|
+
Attributes:
|
|
28
|
+
moves (int): successful move() steps
|
|
29
|
+
turns (int): turn_left() turns
|
|
30
|
+
bumps (int): move() calls that were blocked
|
|
31
|
+
keyboard_moves (int): steps made by hand (WASD)
|
|
32
|
+
interactions (int): interact() calls
|
|
33
|
+
pickups (int): successful pickup() calls
|
|
34
|
+
drops (int): successful drop() calls
|
|
35
|
+
sensor_calls (int): calls of is_*_in_front, is_facing_north, is_at_goal and get_items_at_position
|
|
36
|
+
reads (int): calls of read_item_value and peek_item_value
|
|
37
|
+
questions (int): calls of ask_oracle
|
|
38
|
+
at_goal (bool): the hero stands on the goal field
|
|
39
|
+
game_over (bool): the hero fell into an abyss or was caught by a guard
|
|
40
|
+
level_complete (bool): goal reached and every win condition of the level met
|
|
41
|
+
missing (list[str]): unmet win conditions, e.g. "3 sweets"
|
|
42
|
+
moves_left (int | None | Unset): move() calls left in a level with the map property max_moves (null without a
|
|
43
|
+
budget)
|
|
44
|
+
heroes (int | Unset): number of heroes in the level (co-op levels have more than one)
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
moves: int
|
|
48
|
+
turns: int
|
|
49
|
+
bumps: int
|
|
50
|
+
keyboard_moves: int
|
|
51
|
+
interactions: int
|
|
52
|
+
pickups: int
|
|
53
|
+
drops: int
|
|
54
|
+
sensor_calls: int
|
|
55
|
+
reads: int
|
|
56
|
+
questions: int
|
|
57
|
+
at_goal: bool
|
|
58
|
+
game_over: bool
|
|
59
|
+
level_complete: bool
|
|
60
|
+
missing: list[str]
|
|
61
|
+
moves_left: int | None | Unset = UNSET
|
|
62
|
+
heroes: int | Unset = UNSET
|
|
63
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> dict[str, Any]:
|
|
70
|
+
moves = self.moves
|
|
71
|
+
|
|
72
|
+
turns = self.turns
|
|
73
|
+
|
|
74
|
+
bumps = self.bumps
|
|
75
|
+
|
|
76
|
+
keyboard_moves = self.keyboard_moves
|
|
77
|
+
|
|
78
|
+
interactions = self.interactions
|
|
79
|
+
|
|
80
|
+
pickups = self.pickups
|
|
81
|
+
|
|
82
|
+
drops = self.drops
|
|
83
|
+
|
|
84
|
+
sensor_calls = self.sensor_calls
|
|
85
|
+
|
|
86
|
+
reads = self.reads
|
|
87
|
+
|
|
88
|
+
questions = self.questions
|
|
89
|
+
|
|
90
|
+
at_goal = self.at_goal
|
|
91
|
+
|
|
92
|
+
game_over = self.game_over
|
|
93
|
+
|
|
94
|
+
level_complete = self.level_complete
|
|
95
|
+
|
|
96
|
+
missing = self.missing
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
moves_left: int | None | Unset
|
|
101
|
+
if isinstance(self.moves_left, Unset):
|
|
102
|
+
moves_left = UNSET
|
|
103
|
+
else:
|
|
104
|
+
moves_left = self.moves_left
|
|
105
|
+
|
|
106
|
+
heroes = self.heroes
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
field_dict: dict[str, Any] = {}
|
|
110
|
+
field_dict.update(self.additional_properties)
|
|
111
|
+
field_dict.update({
|
|
112
|
+
"moves": moves,
|
|
113
|
+
"turns": turns,
|
|
114
|
+
"bumps": bumps,
|
|
115
|
+
"keyboard_moves": keyboard_moves,
|
|
116
|
+
"interactions": interactions,
|
|
117
|
+
"pickups": pickups,
|
|
118
|
+
"drops": drops,
|
|
119
|
+
"sensor_calls": sensor_calls,
|
|
120
|
+
"reads": reads,
|
|
121
|
+
"questions": questions,
|
|
122
|
+
"at_goal": at_goal,
|
|
123
|
+
"game_over": game_over,
|
|
124
|
+
"level_complete": level_complete,
|
|
125
|
+
"missing": missing,
|
|
126
|
+
})
|
|
127
|
+
if moves_left is not UNSET:
|
|
128
|
+
field_dict["moves_left"] = moves_left
|
|
129
|
+
if heroes is not UNSET:
|
|
130
|
+
field_dict["heroes"] = heroes
|
|
131
|
+
|
|
132
|
+
return field_dict
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
@classmethod
|
|
137
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
138
|
+
d = dict(src_dict)
|
|
139
|
+
moves = d.pop("moves")
|
|
140
|
+
|
|
141
|
+
turns = d.pop("turns")
|
|
142
|
+
|
|
143
|
+
bumps = d.pop("bumps")
|
|
144
|
+
|
|
145
|
+
keyboard_moves = d.pop("keyboard_moves")
|
|
146
|
+
|
|
147
|
+
interactions = d.pop("interactions")
|
|
148
|
+
|
|
149
|
+
pickups = d.pop("pickups")
|
|
150
|
+
|
|
151
|
+
drops = d.pop("drops")
|
|
152
|
+
|
|
153
|
+
sensor_calls = d.pop("sensor_calls")
|
|
154
|
+
|
|
155
|
+
reads = d.pop("reads")
|
|
156
|
+
|
|
157
|
+
questions = d.pop("questions")
|
|
158
|
+
|
|
159
|
+
at_goal = d.pop("at_goal")
|
|
160
|
+
|
|
161
|
+
game_over = d.pop("game_over")
|
|
162
|
+
|
|
163
|
+
level_complete = d.pop("level_complete")
|
|
164
|
+
|
|
165
|
+
missing = cast(list[str], d.pop("missing"))
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def _parse_moves_left(data: object) -> int | None | Unset:
|
|
169
|
+
if data is None:
|
|
170
|
+
return data
|
|
171
|
+
if isinstance(data, Unset):
|
|
172
|
+
return data
|
|
173
|
+
return cast(int | None | Unset, data)
|
|
174
|
+
|
|
175
|
+
moves_left = _parse_moves_left(d.pop("moves_left", UNSET))
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
heroes = d.pop("heroes", UNSET)
|
|
179
|
+
|
|
180
|
+
statistics = cls(
|
|
181
|
+
moves=moves,
|
|
182
|
+
turns=turns,
|
|
183
|
+
bumps=bumps,
|
|
184
|
+
keyboard_moves=keyboard_moves,
|
|
185
|
+
interactions=interactions,
|
|
186
|
+
pickups=pickups,
|
|
187
|
+
drops=drops,
|
|
188
|
+
sensor_calls=sensor_calls,
|
|
189
|
+
reads=reads,
|
|
190
|
+
questions=questions,
|
|
191
|
+
at_goal=at_goal,
|
|
192
|
+
game_over=game_over,
|
|
193
|
+
level_complete=level_complete,
|
|
194
|
+
missing=missing,
|
|
195
|
+
moves_left=moves_left,
|
|
196
|
+
heroes=heroes,
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
statistics.additional_properties = d
|
|
201
|
+
return statistics
|
|
202
|
+
|
|
203
|
+
@property
|
|
204
|
+
def additional_keys(self) -> list[str]:
|
|
205
|
+
return list(self.additional_properties.keys())
|
|
206
|
+
|
|
207
|
+
def __getitem__(self, key: str) -> Any:
|
|
208
|
+
return self.additional_properties[key]
|
|
209
|
+
|
|
210
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
211
|
+
self.additional_properties[key] = value
|
|
212
|
+
|
|
213
|
+
def __delitem__(self, key: str) -> None:
|
|
214
|
+
del self.additional_properties[key]
|
|
215
|
+
|
|
216
|
+
def __contains__(self, key: str) -> bool:
|
|
217
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..models.statistics_result_status import StatisticsResultStatus
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.statistics import Statistics
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="StatisticsResult")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class StatisticsResult:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
status (StatisticsResultStatus):
|
|
30
|
+
message (str):
|
|
31
|
+
result (Statistics): Counters since the level was (re)loaded.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
status: StatisticsResultStatus
|
|
35
|
+
message: str
|
|
36
|
+
result: Statistics
|
|
37
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
|
44
|
+
from ..models.statistics import Statistics
|
|
45
|
+
status = self.status.value
|
|
46
|
+
|
|
47
|
+
message = self.message
|
|
48
|
+
|
|
49
|
+
result = self.result.to_dict()
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
field_dict: dict[str, Any] = {}
|
|
53
|
+
field_dict.update(self.additional_properties)
|
|
54
|
+
field_dict.update({
|
|
55
|
+
"status": status,
|
|
56
|
+
"message": message,
|
|
57
|
+
"result": result,
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
return field_dict
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
66
|
+
from ..models.statistics import Statistics
|
|
67
|
+
d = dict(src_dict)
|
|
68
|
+
status = StatisticsResultStatus(d.pop("status"))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
message = d.pop("message")
|
|
74
|
+
|
|
75
|
+
result = Statistics.from_dict(d.pop("result"))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
statistics_result = cls(
|
|
81
|
+
status=status,
|
|
82
|
+
message=message,
|
|
83
|
+
result=result,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
statistics_result.additional_properties = d
|
|
88
|
+
return statistics_result
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def additional_keys(self) -> list[str]:
|
|
92
|
+
return list(self.additional_properties.keys())
|
|
93
|
+
|
|
94
|
+
def __getitem__(self, key: str) -> Any:
|
|
95
|
+
return self.additional_properties[key]
|
|
96
|
+
|
|
97
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
98
|
+
self.additional_properties[key] = value
|
|
99
|
+
|
|
100
|
+
def __delitem__(self, key: str) -> None:
|
|
101
|
+
del self.additional_properties[key]
|
|
102
|
+
|
|
103
|
+
def __contains__(self, key: str) -> bool:
|
|
104
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..models.string_array_result_status import StringArrayResultStatus
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="StringArrayResult")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class StringArrayResult:
|
|
25
|
+
"""
|
|
26
|
+
Attributes:
|
|
27
|
+
status (StringArrayResultStatus):
|
|
28
|
+
message (str):
|
|
29
|
+
result (list[str]):
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
status: StringArrayResultStatus
|
|
33
|
+
message: str
|
|
34
|
+
result: list[str]
|
|
35
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_dict(self) -> dict[str, Any]:
|
|
42
|
+
status = self.status.value
|
|
43
|
+
|
|
44
|
+
message = self.message
|
|
45
|
+
|
|
46
|
+
result = self.result
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
field_dict: dict[str, Any] = {}
|
|
52
|
+
field_dict.update(self.additional_properties)
|
|
53
|
+
field_dict.update({
|
|
54
|
+
"status": status,
|
|
55
|
+
"message": message,
|
|
56
|
+
"result": result,
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
return field_dict
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
65
|
+
d = dict(src_dict)
|
|
66
|
+
status = StringArrayResultStatus(d.pop("status"))
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
message = d.pop("message")
|
|
72
|
+
|
|
73
|
+
result = cast(list[str], d.pop("result"))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
string_array_result = cls(
|
|
77
|
+
status=status,
|
|
78
|
+
message=message,
|
|
79
|
+
result=result,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
string_array_result.additional_properties = d
|
|
84
|
+
return string_array_result
|
|
85
|
+
|
|
86
|
+
@property
|
|
87
|
+
def additional_keys(self) -> list[str]:
|
|
88
|
+
return list(self.additional_properties.keys())
|
|
89
|
+
|
|
90
|
+
def __getitem__(self, key: str) -> Any:
|
|
91
|
+
return self.additional_properties[key]
|
|
92
|
+
|
|
93
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
94
|
+
self.additional_properties[key] = value
|
|
95
|
+
|
|
96
|
+
def __delitem__(self, key: str) -> None:
|
|
97
|
+
del self.additional_properties[key]
|
|
98
|
+
|
|
99
|
+
def __contains__(self, key: str) -> bool:
|
|
100
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="TiledLevel")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class TiledLevel:
|
|
23
|
+
""" A Tiled (mapeditor.org) JSON map export. Not fully modeled here - the game engine (game/src/game.js) is the source
|
|
24
|
+
of truth for what it accepts.
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def to_dict(self) -> dict[str, Any]:
|
|
35
|
+
|
|
36
|
+
field_dict: dict[str, Any] = {}
|
|
37
|
+
field_dict.update(self.additional_properties)
|
|
38
|
+
|
|
39
|
+
return field_dict
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
45
|
+
d = dict(src_dict)
|
|
46
|
+
tiled_level = cls(
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
tiled_level.additional_properties = d
|
|
51
|
+
return tiled_level
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def additional_keys(self) -> list[str]:
|
|
55
|
+
return list(self.additional_properties.keys())
|
|
56
|
+
|
|
57
|
+
def __getitem__(self, key: str) -> Any:
|
|
58
|
+
return self.additional_properties[key]
|
|
59
|
+
|
|
60
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
61
|
+
self.additional_properties[key] = value
|
|
62
|
+
|
|
63
|
+
def __delitem__(self, key: str) -> None:
|
|
64
|
+
del self.additional_properties[key]
|
|
65
|
+
|
|
66
|
+
def __contains__(self, key: str) -> bool:
|
|
67
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..models.version_result_status import VersionResultStatus
|
|
12
|
+
from typing import cast
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.version_result_result import VersionResultResult
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="VersionResult")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class VersionResult:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
status (VersionResultStatus):
|
|
30
|
+
message (str):
|
|
31
|
+
result (VersionResultResult):
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
status: VersionResultStatus
|
|
35
|
+
message: str
|
|
36
|
+
result: VersionResultResult
|
|
37
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
|
44
|
+
from ..models.version_result_result import VersionResultResult
|
|
45
|
+
status = self.status.value
|
|
46
|
+
|
|
47
|
+
message = self.message
|
|
48
|
+
|
|
49
|
+
result = self.result.to_dict()
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
field_dict: dict[str, Any] = {}
|
|
53
|
+
field_dict.update(self.additional_properties)
|
|
54
|
+
field_dict.update({
|
|
55
|
+
"status": status,
|
|
56
|
+
"message": message,
|
|
57
|
+
"result": result,
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
return field_dict
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
66
|
+
from ..models.version_result_result import VersionResultResult
|
|
67
|
+
d = dict(src_dict)
|
|
68
|
+
status = VersionResultStatus(d.pop("status"))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
message = d.pop("message")
|
|
74
|
+
|
|
75
|
+
result = VersionResultResult.from_dict(d.pop("result"))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
version_result = cls(
|
|
81
|
+
status=status,
|
|
82
|
+
message=message,
|
|
83
|
+
result=result,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
version_result.additional_properties = d
|
|
88
|
+
return version_result
|
|
89
|
+
|
|
90
|
+
@property
|
|
91
|
+
def additional_keys(self) -> list[str]:
|
|
92
|
+
return list(self.additional_properties.keys())
|
|
93
|
+
|
|
94
|
+
def __getitem__(self, key: str) -> Any:
|
|
95
|
+
return self.additional_properties[key]
|
|
96
|
+
|
|
97
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
98
|
+
self.additional_properties[key] = value
|
|
99
|
+
|
|
100
|
+
def __delitem__(self, key: str) -> None:
|
|
101
|
+
del self.additional_properties[key]
|
|
102
|
+
|
|
103
|
+
def __contains__(self, key: str) -> bool:
|
|
104
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="VersionResultResult")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@_attrs_define
|
|
22
|
+
class VersionResultResult:
|
|
23
|
+
"""
|
|
24
|
+
Attributes:
|
|
25
|
+
extension (str): version of the extension (package.json), e.g. 0.1.0
|
|
26
|
+
api (str): version of this API description (info.version)
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
extension: str
|
|
30
|
+
api: str
|
|
31
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def to_dict(self) -> dict[str, Any]:
|
|
38
|
+
extension = self.extension
|
|
39
|
+
|
|
40
|
+
api = self.api
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
field_dict: dict[str, Any] = {}
|
|
44
|
+
field_dict.update(self.additional_properties)
|
|
45
|
+
field_dict.update({
|
|
46
|
+
"extension": extension,
|
|
47
|
+
"api": api,
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
return field_dict
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
56
|
+
d = dict(src_dict)
|
|
57
|
+
extension = d.pop("extension")
|
|
58
|
+
|
|
59
|
+
api = d.pop("api")
|
|
60
|
+
|
|
61
|
+
version_result_result = cls(
|
|
62
|
+
extension=extension,
|
|
63
|
+
api=api,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
version_result_result.additional_properties = d
|
|
68
|
+
return version_result_result
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def additional_keys(self) -> list[str]:
|
|
72
|
+
return list(self.additional_properties.keys())
|
|
73
|
+
|
|
74
|
+
def __getitem__(self, key: str) -> Any:
|
|
75
|
+
return self.additional_properties[key]
|
|
76
|
+
|
|
77
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
78
|
+
self.additional_properties[key] = value
|
|
79
|
+
|
|
80
|
+
def __delitem__(self, key: str) -> None:
|
|
81
|
+
del self.additional_properties[key]
|
|
82
|
+
|
|
83
|
+
def __contains__(self, key: str) -> bool:
|
|
84
|
+
return key in self.additional_properties
|