component_point_value.py (1807B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\cosmetics\common\ships\skins\static_data\component_point_value.py 2 from cosmetics.common.ships.skins.static_data.component_category import get_category_from_fsd 3 from cosmetics.common.ships.skins.static_data.component_rarity import get_rarity_from_fsd 4 from fsdBuiltData.common.base import BuiltDataLoader 5 try: 6 import ship_skin_design_component_point_valuesLoader 7 except ImportError: 8 ship_skin_design_component_point_valuesLoader = None 9 10 class _ComponentPointValuesDataLoader(BuiltDataLoader): 11 __resBuiltFile__ = 'res:/staticdata/ship_skin_design_component_point_values.fsdbinary' 12 __clientAutobuildBuiltFile__ = 'eve/autobuild/staticData/client/ship_skin_design_component_point_values.fsdbinary' 13 __serverAutobuildBuiltFile__ = 'eve/autobuild/staticData/server/ship_skin_design_component_point_values.fsdbinary' 14 __loader__ = ship_skin_design_component_point_valuesLoader 15 16 17 def get_component_point_values_data(): 18 return _ComponentPointValuesDataLoader.GetData() 19 20 21 class ComponentPointValuesTable(object): 22 23 def __init__(self): 24 self._table = {} 25 self._load_from_fsd(get_component_point_values_data()) 26 27 def _load_from_fsd(self, fsd_data): 28 for component_category, values in fsd_data.iteritems(): 29 key = get_category_from_fsd(component_category) 30 self._table[key] = {} 31 for rarity, points in values.iteritems(): 32 self._table[key][get_rarity_from_fsd(rarity)] = points 33 34 def get_point_value(self, component_category, component_rarity): 35 if component_category in self._table: 36 if component_rarity in self._table[component_category]: 37 return self._table[component_category][component_rarity]