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

skin_design_editor_config.py (2399B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\cosmetics\client\ships\skins\live_data\skin_design_editor_config.py
      2 from eveProto.generated.eve_public.cosmetic.ship.skin.thirdparty.draft.draft_pb2 import EditorConfiguration
      3 
      4 class SkinDesignEditorConfig(object):
      5 
      6     def __init__(self, offset_u_ratio, offset_v_ratio, yaw, pitch, roll, scaling):
      7         self._offset_u_ratio = offset_u_ratio
      8         self._offset_v_ratio = offset_v_ratio
      9         self._yaw = yaw
     10         self._pitch = pitch
     11         self._roll = roll
     12         self._scaling = scaling
     13 
     14     def copy_from_other(self, other):
     15         if other is None:
     16             return
     17         self._offset_u_ratio = other.offset_u_ratio
     18         self._offset_v_ratio = other.offset_v_ratio
     19         self._yaw = other.yaw
     20         self._pitch = other.pitch
     21         self._roll = other.roll
     22         self._scaling = other.scaling
     23 
     24     @property
     25     def offset_u_ratio(self):
     26         return self._offset_u_ratio
     27 
     28     @property
     29     def offset_v_ratio(self):
     30         return self._offset_v_ratio
     31 
     32     @property
     33     def yaw(self):
     34         return self._yaw
     35 
     36     @property
     37     def pitch(self):
     38         return self._pitch
     39 
     40     @property
     41     def roll(self):
     42         return self._roll
     43 
     44     @property
     45     def scaling(self):
     46         return self._scaling
     47 
     48     @staticmethod
     49     def from_proto(proto):
     50         return SkinDesignEditorConfig(offset_u_ratio=proto.offset_u_ratio, offset_v_ratio=proto.offset_v_ratio, yaw=proto.yaw, pitch=proto.pitch, roll=proto.roll, scaling=proto.scaling)
     51 
     52     @staticmethod
     53     def to_proto(obj):
     54         return EditorConfiguration(offset_u_ratio=obj.offset_u_ratio, offset_v_ratio=obj.offset_v_ratio, yaw=obj.yaw, pitch=obj.pitch, roll=obj.roll, scaling=obj.scaling)
     55 
     56     def __eq__(self, other):
     57         if other is None:
     58             return False
     59         return self.offset_u_ratio == other.offset_u_ratio and self.offset_v_ratio == other.offset_v_ratio and self.yaw == other.yaw and self.pitch == other.pitch and self.roll == other.roll and self.scaling == other.scaling
     60 
     61     def __ne__(self, other):
     62         return not self.__eq__(other)
     63 
     64     def __str__(self):
     65         return 'Offset U Ratio: %s\nOffset V Ratio: %s\nYaw: %s\nPitch: %s\nRoll: %s\nScaling: %s' % (self.offset_u_ratio,
     66          self.offset_v_ratio,
     67          self.yaw,
     68          self.pitch,
     69          self.roll,
     70          self.scaling)