def autoSearchCancel(self, value): self.__currentState = value if value == CYBER_SPORT_ALIASES.AUTO_SEARCH_COMMANDS_STATE or value == CYBER_SPORT_ALIASES.AUTO_SEARCH_ERROR_STATE or value == CYBER_SPORT_ALIASES.AUTO_SEARCH_WAITING_PLAYERS_STATE: self.prbEntity.request(AutoSearchUnitCtx(action=0)) elif value == CYBER_SPORT_ALIASES.AUTO_SEARCH_CONFIRMATION_STATE: self.prbEntity.request(DeclineSearchUnitCtx()) elif value == CYBER_SPORT_ALIASES.AUTO_SEARCH_ENEMY_STATE: self.prbEntity.request(BattleQueueUnitCtx(action=0))
def execute(self): pInfo = self._entity.getPlayerInfo() if pInfo.isCommander(): stats = self._entity.getStats() _, unit = self._entity.getUnit() if self._canDoAutoSearch(unit, stats): if self._entity.isParentControlActivated(): return if self._entity.getFlags().isDevMode(): DialogsInterface.showDialog(rally_dialog_meta.UnitConfirmDialogMeta(PREBATTLE_TYPE.UNIT, 'startBattle'), lambda result: self._sendBattleQueueRequest() if result else None) else: ctx = AutoSearchUnitCtx('prebattle/auto_search') LOG_DEBUG('Unit request', ctx) self._entity.doAutoSearch(ctx) else: self._sendBattleQueueRequest() else: self._entity.togglePlayerReadyAction()
def autoSearchApply(self, value): if value == CYBER_SPORT_ALIASES.AUTO_SEARCH_CONFIRMATION_STATE: self.prbEntity.request(AcceptSearchUnitCtx()) elif value == CYBER_SPORT_ALIASES.AUTO_SEARCH_ERROR_STATE: self.__currentState = CYBER_SPORT_ALIASES.AUTO_SEARCH_COMMANDS_STATE self.prbEntity.request(AutoSearchUnitCtx())
def onAutoMatch(self, value, vehTypes): if value == CYBER_SPORT_ALIASES.INTRO_VIEW_UI: self.prbEntity.request(AutoSearchUnitCtx(vehTypes=vehTypes))