Poodletooth-iLand/otp/level/VisibilityBlocker.py

30 lines
840 B
Python
Raw Normal View History

2015-11-14 13:28:53 -06:00
import Entity
class VisibilityBlocker:
def __init__(self):
self.__nextSetZoneDoneEvent = None
return
def destroy(self):
self.cancelUnblockVis()
def requestUnblockVis(self):
if self.__nextSetZoneDoneEvent is None:
self.__nextSetZoneDoneEvent = self.level.cr.getNextSetZoneDoneEvent()
self.acceptOnce(self.__nextSetZoneDoneEvent, self.okToUnblockVis)
self.level.forceSetZoneThisFrame()
return
def cancelUnblockVis(self):
if self.__nextSetZoneDoneEvent is not None:
self.ignore(self.__nextSetZoneDoneEvent)
self.__nextSetZoneDoneEvent = None
return
def isWaitingForUnblockVis(self):
return self.__nextSetZoneDoneEvent is not None
def okToUnblockVis(self):
self.cancelUnblockVis()