Use the more convenient _asdict() function of named tuples.

This commit is contained in:
CaitSith2
2021-03-05 11:05:57 -08:00
parent 60e032510d
commit d0d995b3a4

View File

@@ -1509,11 +1509,7 @@ class PlandoItem(NamedTuple):
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}
return self._asdict()
class PlandoConnection(NamedTuple):
@@ -1522,6 +1518,4 @@ class PlandoConnection(NamedTuple):
direction: str # entrance, exit or both
def to_dict(self):
return {"entrance": self.entrance,
"exit": self.exit,
"direction": self.direction}
return self._asdict()