Example #1
0
 def __proccesRawBlueprints(self, blueprintsRaw):
     for blueprintCD in blueprintsRaw:
         fragmentType = getFragmentType(blueprintCD)
         if fragmentType == BlueprintTypes.INTELLIGENCE_DATA:
             self.__universalBlueprints += blueprintsRaw[blueprintCD]
         if fragmentType == BlueprintTypes.NATIONAL:
             nationID = getFragmentNationID(blueprintCD)
             nationName = nations.MAP.get(nationID, nations.NONE_INDEX)
             self.__nationalBlueprints[nationName] += blueprintsRaw[
                 blueprintCD]
Example #2
0
 def getTypeAndNation(self, fragmentCD=None):
     if fragmentCD is None and self.__blueprintCD is None:
         return
     else:
         fragmentCD = self.__blueprintCD if fragmentCD is None else fragmentCD
         fragmentType = getFragmentType(fragmentCD)
         nation = nations.NAMES[getFragmentNationID(
             fragmentCD
         )] if fragmentType == BlueprintTypes.NATIONAL else None
         return (fragmentType, nation)
Example #3
0
 def getFragmentData(self, fragmentCD=None):
     if fragmentCD is None and self.__blueprintCD is None:
         return
     else:
         fragmentCD = self.__blueprintCD if fragmentCD is None else fragmentCD
         fragmentType = getFragmentType(fragmentCD)
         nation = None
         alliance = None
         if fragmentType in (BlueprintTypes.NATIONAL, BlueprintTypes.VEHICLE):
             nation = nations.NAMES[getFragmentNationID(fragmentCD)]
             alliance = nations.ALLIANCES_TAGS_ORDER[nations.NATION_TO_ALLIANCE_IDS_MAP[nations.INDICES[nation]]]
         return (fragmentType, nation, alliance)
Example #4
0
    def convertBlueprintFragment(self, fragmentTypeCD, position,
                                 requestedCount, usedNationalFragments,
                                 callback):
        _logger.debug('Account.convertBlueprintFragment: fragmentTypeCD=%s',
                      fragmentTypeCD)
        if callback is not None:
            proxy = lambda requestID, resultID, errorStr: callback(resultID)
        else:
            proxy = None
        arr = [fragmentTypeCD, position, requestedCount]
        if usedNationalFragments is not None:
            for k, v in usedNationalFragments.iteritems():
                arr.append(k)
                arr.append(v)

        else:
            arr.append(getFragmentNationID(fragmentTypeCD))
            arr.append(
                self.__itemsCache.items.blueprints.
                getRequiredIntelligenceAndNational(
                    vehicles.getVehicleType(fragmentTypeCD).level)[0])
        self.__account._doCmdIntArr(AccountCommands.CMD_BPF_CONVERT_FRAGMENTS,
                                    arr, proxy)
        return
Example #5
0
 def __getNation(fragmentCD):
     return nations.MAP.get(getFragmentNationID(fragmentCD), nations.NONE_INDEX)