Adding Event Base
This commit is contained in:
18
event.py
Normal file
18
event.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from .serializable import Serializable
|
||||
from .entity import Action, BonusAction
|
||||
|
||||
import json
|
||||
|
||||
class Event(Serializable):
|
||||
def __init__(self, location:str, entities_objectives:dict[str,str]):
|
||||
super().__init__()
|
||||
self.location = location
|
||||
self.entities_objectives = entities_objectives
|
||||
self.description = ""
|
||||
|
||||
def add_turn_event(self, event_text:str, action:Action, bonus:BonusAction):
|
||||
event_dict = {}
|
||||
event_dict['text'] = event_text
|
||||
event_dict['action'] = action
|
||||
event_dict['bonus'] = bonus
|
||||
self.description += json.dumps(event_dict)
|
||||
Reference in New Issue
Block a user