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

corpStructureData.py (1563B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\cosmetics\structure\corpStructureData.py
      2 import evetypes
      3 from cosmetics.common.structures.const import PAINT_ELIGIBLE_STRUCTURE_TYPE_IDS
      4 from structures import UPKEEP_STATE_FULL_POWER, UPKEEP_STATE_LOW_POWER, UPKEEP_STATE_ABANDONED
      5 
      6 class CorpStructureData(object):
      7 
      8     def __init__(self, instance_id, type_id, upkeep_state, location_id, license_id = None):
      9         self.instance_id = instance_id
     10         self.type_id = type_id
     11         self.upkeep_state = upkeep_state
     12         self.location_id = location_id
     13         self.structure_name = cfg.evelocations.Get(instance_id).name
     14         self.location_name = cfg.evelocations.Get(location_id).name
     15         self.type_name = evetypes.GetName(type_id)
     16         self.price_per_duration = {}
     17         self.license_id = license_id
     18 
     19     def __eq__(self, other):
     20         return self.instance_id == other.instance_id
     21 
     22     def get_price_for_duration(self, duration):
     23         return self.price_per_duration.get(duration, None)
     24 
     25     def is_eligible_for_painting(self):
     26         return self.type_id in PAINT_ELIGIBLE_STRUCTURE_TYPE_IDS
     27 
     28     def is_ready_for_painting(self):
     29         return self.upkeep_state == UPKEEP_STATE_FULL_POWER
     30 
     31     def is_low_power(self):
     32         return self.upkeep_state == UPKEEP_STATE_LOW_POWER
     33 
     34     def is_abandoned(self):
     35         return self.upkeep_state == UPKEEP_STATE_ABANDONED
     36 
     37     def is_eligible_for_application(self):
     38         return self.is_eligible_for_painting() and self.is_ready_for_painting()