예제 #1
0
 def __makeOrderInfoData(self, uid):
     self._buildingID = self.getBuildingIDbyUID(uid)
     self._orderID = self.fortCtrl.getFort().getBuildingOrder(
         self._buildingID)
     orderTitle = text_styles.middleTitle(
         i18n.makeString(
             FORTIFICATIONS.orders_orderpopover_ordertype(
                 self.getOrderUIDbyID(self._orderID))))
     descrMSG = i18n.makeString(
         FORTIFICATIONS.buildings_processorderinfo(uid))
     descrMSG = text_styles.main(descrMSG)
     result = {}
     result['title'] = orderTitle
     result['description'] = descrMSG
     buildingId = self.getBuildingIDbyUID(uid)
     buildingDescr = self.fortCtrl.getFort().getBuilding(
         self.getBuildingIDbyUID(uid), BuildingDescr(typeID=buildingId))
     order = self.fortCtrl.getFort().getOrder(
         buildingDescr.typeRef.orderType)
     result['iconSource'] = order.icon
     showAlertIcon, alertIconTooltip = self._showOrderAlertIcon(order)
     result['showAlertIcon'] = showAlertIcon
     result['alertIconTooltip'] = alertIconTooltip
     result['iconLevel'] = None
     return result
 def __buildData(self):
     self.intBuildingID = self.getBuildingIDbyUID(self.__uid)
     self._buildingDescr = self.fortCtrl.getFort().getBuilding(
         self.intBuildingID)
     self.__buildingLevel = max(self._buildingDescr.level, 1)
     self.nextLevel = BuildingDescr(typeID=self.intBuildingID,
                                    level=self.__buildingLevel + 1)
     baseBuilding = self.fortCtrl.getFort().getBuilding(
         FORT_BUILDING_TYPE.MILITARY_BASE)
     self.__baseBuildingLevel = baseBuilding.level
     self.__progress = self._getProgress(self._buildingDescr.typeID,
                                         self.__buildingLevel)
     self.__hpTotalVal = self._buildingDescr.levelRef.hp
     self.__hpVal = self._buildingDescr.hp
     self.__defResVal = self._buildingDescr.storage
     self.__maxDerResVal = self._buildingDescr.levelRef.storage
     self.__cost = self._buildingDescr.levelRef.upgradeCost
     fort = self.fortCtrl.getFort()
     self.__defencePeriod = fort.isDefenceHourEnabled()
     self.as_setDataS(self.__makeData())
예제 #3
0
 def __init__(self, buildingCompactDescr=None, typeID=None):
     BuildingDescr.__init__(self, buildingCompactDescr, typeID=typeID)
     HasStrCD.__init__(self, buildingCompactDescr
                       or self.makeCompactDescr())
예제 #4
0
 def __init__(self, buildingCompactDescr = None, typeID = None):
     BuildingDescr.__init__(self, buildingCompactDescr, typeID=typeID)
     HasStrCD.__init__(self, buildingCompactDescr or self.makeCompactDescr())