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

offerpricing.py (1215B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\view\aurumstore\shared\offerpricing.py
      2 
      3 
      4 def get_offer_price_in_currency(offer, currency):
      5     for pricing in offer.offerPricings:
      6         if pricing.currency == currency:
      7             return pricing.price
      8 
      9 
     10 def get_min_offer_price_in_currency(offers, currency):
     11     prices = [ get_offer_price_in_currency(o, currency) for o in offers ]
     12     prices = [ price for price in prices if price is not None ]
     13     return min(prices) or 0
     14 
     15 
     16 def get_offer_price_and_base_price_in_currency(offer, currency):
     17     for pricing in offer.offerPricings:
     18         if pricing.currency == currency:
     19             return (pricing.price, pricing.basePrice)
     20 
     21     return (None, None)
     22 
     23 
     24 def offer_is_available_in_currency(offer, currency):
     25     return get_offer_price_in_currency(offer, currency) is not None
     26 
     27 
     28 def get_available_currencies(offer):
     29     return [ pricing.currency for pricing in offer.offerPricings ]
     30 
     31 
     32 def get_number_of_available_currencies(offer):
     33     return len(get_available_currencies(offer))
     34 
     35 
     36 def iter_currencies(offer):
     37     for pricing in offer.offerPricings:
     38         yield (pricing.currency, pricing.price, pricing.basePrice)