示例#1
0
class DialogManager(object):
        
    def __init__(self, dialog_xml, event_xml):
        self._dialog_factory = DialogFactory(dialog_xml)
        self._event_factory = EventFactory(event_xml)
        
    def update(self, stats):
        if(random.random()**stats['level'] < 0.1):
            self._event_factory.generate_event()
            self._event_factory.evaluate_event(stats)
        self._dialog_factory.update()
示例#2
0
 def __init__(self, dialog_xml, event_xml):
     self._dialog_factory = DialogFactory(dialog_xml)
     self._event_factory = EventFactory(event_xml)