def getConditions(self): rootNode = super(AccountRequirements, self).getConditions() if self._questType == EVENT_TYPE.CLUBS_QUEST and not rootNode.find( 'hasClub'): rootNode.add( conditions.HasClub(formatters.makeUniquePath( 'root', 'hasClub'))) return rootNode
def _parseNode(self, uniquePath, section, group, isNegative=False): for idx, (nodeName, nodeData) in enumerate(section): newNode = None uniqueName = formatters.makeUniquePath(uniquePath, nodeName) if nodeName in self.LOGICAL_OPS: newNode = self.LOGICAL_OPS[nodeName](isNegative) self._parseNode(uniqueName, nodeData, newNode) elif nodeName == self.NEGATIVE_OP: self._parseNode(uniqueName, nodeData, group, True) else: if group.find(nodeName) is not None: uniqueName = "%s%d" % (uniqueName, idx) newNode = self._handleCondition(nodeName, nodeData, uniqueName, group) if newNode is not None and isNegative: newNode.negate() if newNode is not None: group.add(newNode)
def _parseNode(self, uniquePath, section, group, isNegative=False): for idx, (nodeName, nodeData) in enumerate(section): newNode = None uniqueName = formatters.makeUniquePath(uniquePath, nodeName) if nodeName in self.LOGICAL_OPS: newNode = self.LOGICAL_OPS[nodeName](isNegative) self._parseNode(uniqueName, nodeData, newNode) elif nodeName == self.NEGATIVE_OP: self._parseNode(uniqueName, nodeData, group, True) else: if group.find(nodeName) is not None: uniqueName = '%s%d' % (uniqueName, idx) newNode = self._handleCondition(nodeName, nodeData, uniqueName, group) if newNode is not None and isNegative: newNode.negate() if newNode is not None: group.add(newNode)
def getConditions(self): rootNode = super(AccountRequirements, self).getConditions() if self._questType == EVENT_TYPE.CLUBS_QUEST and not rootNode.find('hasClub'): rootNode.add(conditions.HasClub(formatters.makeUniquePath('root', 'hasClub'))) return rootNode