Event & Dice corrections
This commit is contained in:
12
event.py
12
event.py
@@ -1,5 +1,5 @@
|
||||
from .serializable import Serializable
|
||||
from .entity import Action, BonusAction
|
||||
from .entity import Action, BonusAction, Entity
|
||||
|
||||
import json
|
||||
|
||||
@@ -15,4 +15,12 @@ class Event(Serializable):
|
||||
event_dict['text'] = event_text
|
||||
event_dict['action'] = action
|
||||
event_dict['bonus'] = bonus
|
||||
self.description += json.dumps(event_dict)
|
||||
self.description += json.dumps(event_dict)
|
||||
|
||||
def update_objectives(self, entities:list[Entity], objectives:list[str]):
|
||||
assert len(entities) == len(objectives), f"Number of entities & objectives are different: {len(entities)} (entities) and {len(objectives)} (objectives) !"
|
||||
n = len(entities)
|
||||
for i in range(n):
|
||||
entity_name = entities[i].name
|
||||
objective = objectives[i]
|
||||
self.entities_objectives[entity_name] = objective
|
||||
Reference in New Issue
Block a user