def _updateMembersData(self):
     entity = self.prbEntity
     self._setActionButtonState()
     if entity.isStrongholdSettingsValid():
         header = entity.getStrongholdSettings().getHeader()
         maxPlayerCount = header.getMaxPlayersCount()
         self._updateTableHeader(maxPlayerCount, header.getMaxLegionariesCount())
         self.as_setMembersS(*vo_converters.makeSlotsVOs(entity, entity.getID(), app=self.app, maxPlayerCount=maxPlayerCount))
예제 #2
0
 def _updateMembersData(self):
     entity = self.prbEntity
     dataOne, slots = vo_converters.makeSlotsVOs(entity,
                                                 entity.getUnitIdx(),
                                                 app=self.app)
     self.__updateLabels()
     self.as_setMembersS(dataOne, slots)
     self._setActionButtonState()
 def _updateMembersData(self):
     functional = self.unitFunctional
     dataOne, slots = vo_converters.makeSlotsVOs(functional,
                                                 functional.getUnitIdx(),
                                                 app=self.app)
     self.__updateLabels()
     self.as_setMembersS(dataOne, slots)
     self._setActionButtonState()
def makeStrongholdsSlotsVOs(unitEntity,
                            unitMgrID=None,
                            app=None,
                            maxPlayerCount=MAX_PLAYER_COUNT_ALL):
    isRosterSet, slots = makeSlotsVOs(unitEntity, unitMgrID, app,
                                      maxPlayerCount)
    isCommander = unitEntity.isCommander()
    fullData = unitEntity.getUnitFullData(unitMgrID=unitMgrID)
    isPlayersMatchingAvailable = unitEntity.isPlayersMatchingAvailable()
    slotFilters = unitEntity.getSlotFilters().items()
    vehTypesInSlotFilters = {
        slotId: _convertVehClassNamesToState(item.get('vehicle_types', []))
        for slotId, item in slotFilters
    }
    vehiclesInSlotFilters = {
        slotId: item.get('vehicle_cds', [])
        for slotId, item in slotFilters
    }
    canSetupPlayersMatching = isPlayersMatchingAvailable and isCommander
    rosterSettings = unitEntity.getRosterSettings()
    legionariesMaxCount = rosterSettings.getLegionariesMaxCount()
    legionariesInRoster = fullData.stats.legionariesInRoster
    playersMatchingSlotsCount = fullData.stats.playersMatchingSlotsCount
    maxLegionariesNotReached = legionariesMaxCount > legionariesInRoster + playersMatchingSlotsCount
    slotsInPlayersMatching = unitEntity.getSlotsInPlayersMatching()
    unitInPlayersMatchingMode = unitEntity.inPlayersMatchingMode()
    for idx, slot in enumerate(slots):
        if slot['isLocked']:
            break
        vehTypesInSlot = vehTypesInSlotFilters.get(idx, 0)
        vehiclesInSlot = vehiclesInSlotFilters.get(idx, ())
        if slot['selectedVehicle'] and not slot['isFreezed'] and not slot[
                'isCommanderState']:
            slot['selectedVehicle']['isReadyToFight'] = True
        slot['isMatchingEnabled'] = canSetupPlayersMatching
        slot['isFiltersEnabled'] = maxLegionariesNotReached
        if slot['player'] is not None:
            slot['filterState'] = 0
            slot['vehicles'] = ()
            continue
        slot['filterState'] = vehTypesInSlot
        slot['vehicles'] = vehiclesInSlot
        if idx in slotsInPlayersMatching or unitInPlayersMatchingMode:
            if isCommander:
                slotLabel = i18n.makeString(
                    FORTIFICATIONS.SORTIE_MEMBER_SLOT_FOR_LEGIONARY)
            else:
                slotLabel = i18n.makeString(
                    FORTIFICATIONS.SORTIE_MEMBER_SLOT_FOR_LEGIONARY_SEARCH)
            slot.update({
                'canBeTaken': False,
                'isLegionaries': True,
                'slotLabel': slotLabel,
                'playerStatus': PLAYER_GUI_STATUS.READY,
                'isFiltersEnabled': True
            })

    return (isRosterSet, slots)
예제 #5
0
 def _updateMembersData(self):
     entity = self.prbEntity
     self.as_setMembersS(*vo_converters.makeSlotsVOs(
         entity, entity.getUnitIdx(), app=self.app))
     self._setActionButtonState()
예제 #6
0
 def _updateMembersData(self):
     functional = self.unitFunctional
     self.as_setMembersS(*vo_converters.makeSlotsVOs(functional, functional.getUnitIdx(), app=self.app))
     self._setActionButtonState()
예제 #7
0
 def _updateMembersData(self):
     functional = self.unitFunctional
     self.as_setMembersS(*vo_converters.makeSlotsVOs(functional, functional.getUnitIdx(), app=self.app))
     self._setActionButtonState()
 def __getSlots(self):
     functional = self.unitFunctional
     _, slots = vo_converters.makeSlotsVOs(functional, functional.getUnitIdx(), app=self.app)
     return slots
 def _updateMembersData(self):
     functional = self.unitFunctional
     dataOne, slots = vo_converters.makeSlotsVOs(functional, functional.getUnitIdx(), app=self.app)
     self.__updateLabels()
     self.as_setMembersS(dataOne, slots)
     self._setActionButtonState()
예제 #10
0
 def __getSlots(self):
     entity = self.prbEntity
     _, slots = vo_converters.makeSlotsVOs(entity,
                                           entity.getUnitIdx(),
                                           app=self.app)
     return slots
예제 #11
0
 def __getSlots(self):
     functional = self.unitFunctional
     _, slots = vo_converters.makeSlotsVOs(functional,
                                           functional.getUnitIdx(),
                                           app=self.app)
     return slots
 def _updateMembersData(self):
     entity = self.prbEntity
     self.as_setMembersS(*vo_converters.makeSlotsVOs(entity, entity.getID(), withPrem=True))
     self._setActionButtonState()
     self.__updateHeader()