MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / setAsPattern

Method setAsPattern

service/fit.py:442–458  ·  view source on GitHub ↗
(self, fitID, ammo)

Source from the content-addressed store, hash-verified

440 self.recalc(fit)
441
442 def setAsPattern(self, fitID, ammo):
443 pyfalog.debug("Set as pattern for fit ID: {0}", fitID)
444 if fitID is None:
445 return
446
447 sDP = DamagePattern.getInstance()
448 dp = sDP.getDamagePattern("Selected Ammo")
449 if dp is None:
450 dp = es_DamagePattern()
451 dp.rawName = "Selected Ammo"
452
453 fit = eos.db.getFit(fitID)
454 for attr in ("em", "thermal", "kinetic", "explosive"):
455 setattr(dp, "%sAmount" % attr, ammo.getAttribute("%sDamage" % attr) or 0)
456
457 fit.damagePattern = dp
458 self.recalc(fit)
459
460 def setRahPattern(self, fitID, module, pattern):
461 pyfalog.debug("Set as pattern for fit ID: {0}", fitID)

Callers 1

activateMethod · 0.80

Calls 5

recalcMethod · 0.95
getFitMethod · 0.80
getAttributeMethod · 0.80
getInstanceMethod · 0.45
getDamagePatternMethod · 0.45

Tested by

no test coverage detected