def __getPotapovHiddenQuests(self): if not self.__potapovHidden: xmlPath = _POTAPOV_QUEST_XML_PATH + '/tiles.xml' for quest in readQuestsFromFile(xmlPath, EVENT_TYPE.TOKEN_QUEST): self.__potapovHidden[quest[0]] = quest[3] return self.__potapovHidden.copy()
def __getPersonalMissionsHiddenQuests(self): if not self.__personalMissionsHidden: xmlPath = PERSONAL_MISSIONS_XML_PATH + '/tiles.xml' for quest in readQuestsFromFile(xmlPath, EVENT_TYPE.TOKEN_QUEST): self.__personalMissionsHidden[quest[0]] = quest[3] return self.__personalMissionsHidden.copy()
def motivationQuestsFromFile(pathToFile): quests = {} for quest in readQuestsFromFile(pathToFile, EVENT_TYPE.MOTIVE_QUEST): questID, questName, questDescr, questClientData, node = quest questData = __parseMotivationsQuest(node) if questData is None: LOG_WARNING('Not all required fields are specified in quest for {}.'.format(questID)) continue advice, requirements, congratulation = questData quests[questID] = MotivationQuest(questID, questName, questDescr, advice, requirements, congratulation, questClientData) return quests
def fromDirectory(cls, directory): LOG_DEBUG_DEV('clubs_quests initialization') questFile = os.path.join(directory, _LADDER_QUESTS_FILE) ladderQuests = {} for quest in readQuestsFromFile(questFile, EVENT_TYPE.CLUBS_QUEST): questID, questName, questDescr, questClientData, node = quest ladderQuestData = _parseLadderQuest(node) if ladderQuestData is None: LOG_DEBUG_DEV('Not all required fields are specified in postBattle/clubs/* for {}.'.format(questID)) continue seasonID, division, minBattles = ladderQuestData item = LadderQuest(questID, questName, questDescr, division, minBattles, questClientData) ladderQuests.setdefault(seasonID, list()).append(item) obj = cls(ladderQuests) return obj