fix some naming in events, make selectDg return the result of calling the dg

This commit is contained in:
Jeremy Penner 2011-09-30 08:46:56 -04:00
parent a061e0f8ee
commit df82add732

View file

@ -18,7 +18,7 @@ class Event(TPrs):
def InitTransient(self):
self.rgtk = TPLS()
self.stkValue = []
self.queueValue = []
def oob(self, tok, dgoob):
return Oob(self, tok, dgoob)
@ -59,17 +59,17 @@ class Event(TPrs):
def selectDg(cls, tok, *rgev_dg):
rgev, rgdg = zip(*rgev_dg)
ev, value = cls.select(tok, *rgev)
rgdg[rgev.index(ev)](value)
return rgdg[rgev.index(ev)](value)
def fire(self, value = None):
self.stkValue.append(value)
self.queueValue.append(value)
self.game.queueEv.append(self)
self.game.ensureRun()
def fireI(self):
rgtkOld = self.rgtk
value = self.stkValue[0]
self.stkValue = self.stkValue[1:]
value = self.queueValue[0]
self.queueValue = self.queueValue[1:]
self.rgtk = TPLS()
for tk in rgtkOld:
if tk.fRunning: