Exemple #1
0
    def from_json(cls, json_data):
        traits = TraitList.list_from_json(json_data["traits"])

        complication = cls(
            complication_id=json_data["id"],
            name=json_data["name"],
            description=json_data["description"],
            objectives=json_data["objectives"],
            chance=json_data["chance"],
            traits=traits,
        )

        return complication
Exemple #2
0
    def from_json(cls, mission, objective, json_data):
        traits = TraitList.list_from_json(json_data["traits"])

        solution = cls(
            mission=mission,
            objective=objective,
            solution_id=json_data["id"],
            name=json_data["name"],
            type=json_data["type"],
            traits=traits,
        )

        return solution