MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / getResistanceAttrID

Function getResistanceAttrID

eos/modifiedAttributeDict.py:51–68  ·  view source on GitHub ↗
(modifyingItem, effect)

Source from the content-addressed store, hash-verified

49
50
51def getResistanceAttrID(modifyingItem, effect):
52 # If it doesn't exist on the effect, check the modifying module's attributes.
53 # If it's there, cache it and return
54 if effect.resistanceID:
55 return effect.resistanceID
56 cacheKey = (modifyingItem.item.ID, effect.ID)
57 try:
58 return resistanceCache[cacheKey]
59 except KeyError:
60 attrPrefix = effect.getattr('prefix')
61 if attrPrefix:
62 resistanceID = int(modifyingItem.getModifiedItemAttr('{}ResistanceID'.format(attrPrefix))) or None
63 if not resistanceID:
64 resistanceID = int(modifyingItem.getModifiedItemAttr('{}RemoteResistanceID'.format(attrPrefix))) or None
65 else:
66 resistanceID = int(modifyingItem.getModifiedItemAttr("remoteResistanceID")) or None
67 resistanceCache[cacheKey] = resistanceID
68 return resistanceID
69
70
71class ItemAttrShortcut:

Callers 4

getProjModDataMethod · 0.90
getProjDroneDataMethod · 0.90
getProjFighterDataMethod · 0.90
getResistanceMethod · 0.85

Calls 2

getattrMethod · 0.80
getModifiedItemAttrMethod · 0.45

Tested by

no test coverage detected