diff --git a/speedruncompy/data_structures.py b/speedruncompy/data_structures.py index 50dcc91..f18936b 100644 --- a/speedruncompy/data_structures.py +++ b/speedruncompy/data_structures.py @@ -4,6 +4,12 @@ class Datatype(): def __repr__(self) -> str: return str(self.__dict__) + def __getitem__(self, key): + return self.__dict__[key] + + def __setitem__(self, key, value): + self.__dict__[key] = value + class VariableValue(Datatype): def __init__(self, construct:Union[tuple[str, str], dict[str, str]]) -> None: if type(construct) is tuple: @@ -44,4 +50,4 @@ def __init__(self, dict:dict[str, Any] = {}) -> None: self.video = dict.get("video", 0) self.comment = dict.get("comment", "") self.date = dict.get("date", "") - self.values: list[VariableValue] = dict.get("values", []) \ No newline at end of file + self.values: list[VariableValue] = VariableValue(dict.get("values", [])) \ No newline at end of file