def _makeVO(self, index, item, battleItem): if item.getType() == BATTLE_ITEM_TYPE.DEFENCE: battleType = FORTIFICATION_ALIASES.CLAN_BATTLE_DEFENCE else: battleType = FORTIFICATION_ALIASES.CLAN_BATTLE_OFFENCE if battleItem: startTime = battleItem.getRoundStartTime() startTimeLeft = battleItem.getRoundStartTimeLeft() isBattleRound = battleItem.isBattleRound() else: startTime = item.getStartTime() startTimeLeft = item.getStartTimeLeft() isBattleRound = False dayOfBattle = self.DAY_OF_BATTLE.TODAY if startTimeLeft > time_utils.QUARTER_HOUR: stateOfBattle = FORTIFICATION_ALIASES.CLAN_BATTLE_BATTLE_TOMORROW if time_utils.isTimeThisDay(startTime): stateOfBattle = FORTIFICATION_ALIASES.CLAN_BATTLE_BATTLE_TODAY elif time_utils.isTimeNextDay(startTime): dayOfBattle = self.DAY_OF_BATTLE.TOMORROW else: dayOfBattle = self.DAY_OF_BATTLE.OTHER elif startTimeLeft > 0 and not isBattleRound: stateOfBattle = FORTIFICATION_ALIASES.CLAN_BATTLE_BEGINS else: stateOfBattle = FORTIFICATION_ALIASES.CLAN_BATTLE_IS_IN_BATTLE return {'sortieID': (item.getBattleID(), item.getPeripheryID()), 'battleType': battleType, 'battleName': self.__makeBattleName(item, battleType), 'battleDirection': self.__makeBattleDirection(item), 'dayOfBattle': self.__makeDayOfBattle(dayOfBattle, startTime), 'beforeBegins': self.__makeTimeOfBattle(item, battleItem, stateOfBattle), 'stateOfBattle': stateOfBattle, 'startTimeLeft': startTimeLeft, 'direction': item.getDirection()}
def __getBattleInfo(self, startTime, startTimeLeft): if startTimeLeft > time_utils.QUARTER_HOUR: if time_utils.isTimeNextDay(startTime): return text_styles.standard(i18n.makeString(FORTIFICATIONS.FORTINTELLIGENCE_DATE_TOMORROW)) if time_utils.isTimeThisDay(startTime): return text_styles.standard(i18n.makeString(FORTIFICATIONS.FORTINTELLIGENCE_DATE_TODAY)) else: if startTimeLeft > 0: return text_styles.standard(i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_BEFOREBATTLE) + ' ') inBattleText = ' ' + i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_ISBATTLE) return text_styles.error(icons.swords() + inBattleText) return ''
def __getBattleInfo(self, startTime, startTimeLeft): if startTimeLeft > time_utils.QUARTER_HOUR: if time_utils.isTimeNextDay(startTime): return self.app.utilsManager.textManager.getText(i18n.makeString(FORTIFICATIONS.FORTINTELLIGENCE_DATE_TOMORROW), TextType.STANDARD_TEXT) if time_utils.isTimeThisDay(startTime): return self.app.utilsManager.textManager.getText(i18n.makeString(FORTIFICATIONS.FORTINTELLIGENCE_DATE_TODAY), TextType.STANDARD_TEXT) else: if startTimeLeft > 0: return self.app.utilsManager.textManager.getText(TextType.STANDARD_TEXT, i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_BEFOREBATTLE) + ' ') inBattleText = ' ' + i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_ISBATTLE) return self.app.utilsManager.textManager.concatStyles(((TextIcons.SWORDS,), (TextType.ERROR_TEXT, inBattleText))) return ''
def __getBattleInfo(self, startTime, startTimeLeft): if startTimeLeft > time_utils.QUARTER_HOUR: if time_utils.isTimeNextDay(startTime): return self.app.utilsManager.textManager.getText(i18n.makeString(FORTIFICATIONS.FORTINTELLIGENCE_DATE_TOMORROW), TEXT_MANAGER_STYLES.STANDARD_TEXT) if time_utils.isTimeThisDay(startTime): return self.app.utilsManager.textManager.getText(i18n.makeString(FORTIFICATIONS.FORTINTELLIGENCE_DATE_TODAY), TEXT_MANAGER_STYLES.STANDARD_TEXT) else: if startTimeLeft > 0: return self.app.utilsManager.textManager.getText(TEXT_MANAGER_STYLES.STANDARD_TEXT, i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_BEFOREBATTLE) + ' ') inBattleText = ' ' + i18n.makeString(FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_ISBATTLE) return text_styles.error(icons.swords() + inBattleText) return ''
def __getBattleInfo(self, startTime, startTimeLeft): if startTimeLeft > time_utils.QUARTER_HOUR: if time_utils.isTimeNextDay(startTime): return text_styles.standard( i18n.makeString( FORTIFICATIONS.FORTINTELLIGENCE_DATE_TOMORROW)) if time_utils.isTimeThisDay(startTime): return text_styles.standard( i18n.makeString( FORTIFICATIONS.FORTINTELLIGENCE_DATE_TODAY)) else: if startTimeLeft > 0: return text_styles.standard( i18n.makeString( FORTIFICATIONS. FORTCLANBATTLELIST_RENDERCURRENTTIME_BEFOREBATTLE) + ' ') inBattleText = ' ' + i18n.makeString( FORTIFICATIONS.FORTCLANBATTLELIST_RENDERCURRENTTIME_ISBATTLE) return text_styles.error(icons.swords() + inBattleText) return ''