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()
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()
def restoreKnows(self, knows): if isKnows(knows): self._createKnowsFunction(knows) Cache.reset() else: raise ValueError("Invalid knows " + str(knows))
def changeKnows(self, knows, newVal): if isKnows(knows): self._setKnowsFunction(knows, newVal) Cache.reset() else: raise ValueError("Invalid knows " + str(knows))