def __init__(self):
        self._items = {}
        self._counts = {}

        # cache related
        self.cacheKey = 0
        self.computeItemsPositions()
        Cache.reset()

        self.helpers = Logic.HelpersGraph(self)
        self.doorsManager = DoorsManager()
        self.createFacadeFunctions()
        self.createKnowsFunctions()
        self.resetItems()
Ejemplo n.º 2
0
    def __init__(self, player=0, maxDiff=sys.maxsize, onlyBossLeft=False):
        self._items = {}
        self._counts = {}

        self.player = player
        self.maxDiff = maxDiff
        self.onlyBossLeft = onlyBossLeft

        # cache related
        self.cacheKey = 0
        self.computeItemsPositions()
        Cache.reset()
        Logic.factory('vanilla')
        self.helpers = Logic.HelpersGraph(self)
        self.doorsManager = DoorsManager()
        self.createFacadeFunctions()
        self.createKnowsFunctions(player)
        self.resetItems()
Ejemplo n.º 3
0
 def restoreKnows(self, knows):
     if isKnows(knows):
         self._createKnowsFunction(knows)
         Cache.reset()
     else:
         raise ValueError("Invalid knows " + str(knows))
Ejemplo n.º 4
0
 def changeKnows(self, knows, newVal):
     if isKnows(knows):
         self._setKnowsFunction(knows, newVal)
         Cache.reset()
     else:
         raise ValueError("Invalid knows " + str(knows))