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

fitting.py (1129B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\cosmetics\common\structures\fitting.py
      2 from cosmetics.common.structures.const import StructurePaintSlot
      3 
      4 class StructurePaintwork(object):
      5 
      6     def __init__(self):
      7         self._slots = {StructurePaintSlot.PRIMARY: None,
      8          StructurePaintSlot.SECONDARY: None,
      9          StructurePaintSlot.DETAILING: None}
     10 
     11     def clear(self):
     12         for slot_index in self._slots:
     13             self._slots[slot_index] = None
     14 
     15     def get_slot(self, slot_index):
     16         if slot_index not in self._slots:
     17             raise KeyError('slot %s not defined' % slot_index)
     18         return self._slots[slot_index]
     19 
     20     def get_slots(self):
     21         return self._slots
     22 
     23     def get_slot_values(self):
     24         return tuple(self._slots.values())
     25 
     26     def set_slot(self, slot_index, slot_value):
     27         if slot_index not in self._slots:
     28             raise KeyError('slot %s not defined' % slot_index)
     29         self._slots[slot_index] = slot_value
     30 
     31     def __eq__(self, other):
     32         return all([ other.get_slot(key) == val for key, val in self._slots.iteritems() ])