NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

utils.py (1782B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\assetholding\client\inventory\utils.py
      2 from inventoryutil.client.inventory import are_types_in_current_location, get_type_quantities_in_current_location
      3 
      4 def are_items_available(items, sourceLocationsOptionsList):
      5     for sourceLocationOptions in sourceLocationsOptionsList:
      6         item_and_flag, owner_location, owner_home = sourceLocationOptions
      7         if item_and_flag is not None:
      8             _item_id, _flag = item_and_flag
      9             raise NotImplementedError('Not implemented yet: are_items_available support for sourceLocationItemAndFlag')
     10         elif owner_location:
     11             if are_types_in_current_location(items):
     12                 return True
     13         elif owner_home:
     14             raise NotImplementedError('Not implemented yet: are_items_available support for sourceLocationOwnerHome')
     15         else:
     16             raise ValueError('sourceLocationOptions requires exactly one option be set - got {0}'.format(sourceLocationOptions))
     17 
     18     return False
     19 
     20 
     21 def get_items_available(quantity_by_type_id, sourceLocationOptions):
     22     item_and_flag, owner_location, owner_home = sourceLocationOptions
     23     if item_and_flag is not None:
     24         _item_id, _flag = item_and_flag
     25         raise NotImplementedError('Not implemented yet: get_items_available support for sourceLocationItemAndFlag')
     26     else:
     27         if owner_location:
     28             return get_type_quantities_in_current_location(quantity_by_type_id)
     29         if owner_home:
     30             raise NotImplementedError('Not implemented yet: get_items_available support for sourceLocationOwnerHome')
     31         else:
     32             raise ValueError('sourceLocationOptions requires exactly one option be set - got {0}'.format(sourceLocationOptions))