Make pre_rolled safer by converting namespace/plandoitems/plandoconnections to/from dict.

This commit is contained in:
CaitSith2
2021-03-05 02:50:40 -08:00
parent 2b553cd1c5
commit 60e032510d
2 changed files with 34 additions and 2 deletions

View File

@@ -1508,8 +1508,20 @@ class PlandoItem(NamedTuple):
else:
self.warn(warning)
def to_dict(self):
return {"item": self.item,
"location": self.location,
"world": self.world,
"from_pool": self.from_pool,
"force": self.force}
class PlandoConnection(NamedTuple):
entrance: str
exit: str
direction: str # entrance, exit or both
def to_dict(self):
return {"entrance": self.entrance,
"exit": self.exit,
"direction": self.direction}