save/load participants, objectives, sectors, choices & battles
This commit is contained in:
parent
7fbdacf97c
commit
6cd3a060c7
9 changed files with 152 additions and 11 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from __future__ import annotations
|
||||
from typing import Any, Dict
|
||||
from uuid import uuid4
|
||||
|
||||
|
||||
|
|
@ -16,3 +17,16 @@ class Objective:
|
|||
|
||||
def set_description(self, new_description: str) -> None:
|
||||
self.description = new_description
|
||||
|
||||
def toDict(self) -> Dict[str, Any]:
|
||||
return {
|
||||
"id": self.id,
|
||||
"name": self.name,
|
||||
"description": self.description,
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def fromDict(data: Dict[str, Any]) -> Objective:
|
||||
obj = Objective(data["name"], data["description"])
|
||||
obj.set_id(data["id"])
|
||||
return obj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue