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

entry.py (2067B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\achievement_system\client\model\definition\contribution_method\parameter\entry.py
      2 from achievement_system.client.model.definition.contribution_method.parameter.attributes import ContributionMethodParameterAttributes
      3 from achievement_system.client.model.definition.contribution_method.parameter.identifier import ContributionMethodParameterIdentifier
      4 from achievement_system.client.model.flatbuffer.generated import MethodParamDefinition as FlatbufferMethodParamDefinition
      5 from parameter_types.const import TextType
      6 from parameter_types.data.matcher import MatcherParameterDefinition
      7 
      8 class ContributionMethodParameterEntry(object):
      9 
     10     def __init__(self, identifier, attributes):
     11         self._identifier = identifier
     12         self._attributes = attributes
     13 
     14     @property
     15     def identifier(self):
     16         return self._identifier
     17 
     18     @property
     19     def attributes(self):
     20         return self._attributes
     21 
     22     def get_ui_controller(self):
     23         return MatcherParameterDefinition(parameter_key=self.identifier.key, parameter_type=self.attributes.param_type, title_id=self.attributes.name_message.identifier, description_id=self.attributes.description_message.identifier, icon_id=self.attributes.icon_id, max_entries=0, text_type=TextType.LOCALIZATION_MESSAGE_IDS, optional=False, unset_description=None, accepted_value_types=self.attributes.accepted_value_types if len(self.attributes.accepted_value_types) else None)
     24 
     25     @classmethod
     26     def from_flatbuffer(cls, fb_data):
     27         return ContributionMethodParameterEntry(identifier=ContributionMethodParameterIdentifier.from_flatbuffer(fb_data.Key()), attributes=ContributionMethodParameterAttributes.from_flatbuffer(fb_data))
     28 
     29     def __eq__(self, other):
     30         return self.identifier == other.identifier and self.attributes == other.attributes
     31 
     32     def __ne__(self, other):
     33         return not self.__eq__(other)
     34 
     35     def __str__(self):
     36         return 'identifier: %s\n' % self.identifier + 'attributes: %s\n' % self.attributes