本文整理汇总了Python中service.damagePattern.DamagePattern类的典型用法代码示例。如果您正苦于以下问题:Python DamagePattern类的具体用法?Python DamagePattern怎么用?Python DamagePattern使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DamagePattern类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self):
pyfalog.debug("Initialize Fit class")
self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
self.targetResists = None
self.character = saveddata_Character.getAll5()
self.booster = False
self.dirtyFitIDs = set()
serviceFittingDefaultOptions = {
"useGlobalCharacter": False,
"useGlobalDamagePattern": False,
"defaultCharacter": self.character.ID,
"useGlobalForceReload": False,
"colorFitBySlot": False,
"rackSlots": True,
"rackLabels": True,
"compactSkills": True,
"showTooltip": True,
"showMarketShortcuts": False,
"enableGaugeAnimation": True,
"exportCharges": True,
"openFitInNew": False,
"priceSystem": "Jita",
"priceSource": "eve-marketdata.com",
"showShipBrowserTooltip": True,
"marketSearchDelay": 250
}
self.serviceFittingOptions = SettingsProvider.getInstance().getSettings(
"pyfaServiceFittingOptions", serviceFittingDefaultOptions)
示例2: getText
def getText(self, itmContext, selection):
sDP = import_DamagePattern.getInstance()
sFit = Fit.getInstance()
fitID = self.mainFrame.getActiveFit()
self.fit = sFit.getFit(fitID)
self.patterns = sDP.getDamagePatternList()
self.patterns.sort(key=lambda p: (p.name not in ["Uniform", "Selected Ammo"], p.name))
self.patternIds = {}
self.subMenus = OrderedDict()
self.singles = []
# iterate and separate damage patterns based on "[Parent] Child"
for pattern in self.patterns:
start, end = pattern.name.find('['), pattern.name.find(']')
if start is not -1 and end is not -1:
currBase = pattern.name[start + 1:end]
# set helper attr
setattr(pattern, "_name", pattern.name[end + 1:].strip())
if currBase not in self.subMenus:
self.subMenus[currBase] = []
self.subMenus[currBase].append(pattern)
else:
self.singles.append(pattern)
# return list of names, with singles first followed by submenu names
self.m = map(lambda p: p.name, self.singles) + self.subMenus.keys()
return self.m
示例3: __init__
def __init__(self):
self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
self.character = Character.getInstance().all5()
self.dirtyFitIDs = set()
serviceFittingDefaultOptions = {"useGlobalCharacter": False, "useGlobalDamagePattern": False, "defaultCharacter": self.character.ID, "useGlobalForceReload": False}
self.serviceFittingOptions = SettingsProvider.getInstance().getSettings("pyfaServiceFittingOptions", serviceFittingDefaultOptions)
示例4: ValuesUpdated
def ValuesUpdated(self, event=None):
if self.block:
return
p = self.entityEditor.getActiveEntity()
total = sum([getattr(self, "%sEdit" % attr).GetValue() for attr in self.DAMAGE_TYPES])
for type_ in self.DAMAGE_TYPES:
editObj = getattr(self, "%sEdit" % type_)
percObj = getattr(self, "%sPerc" % type_)
setattr(p, "%sAmount" % type_, editObj.GetValue())
percObj.SetLabel("%.1f%%" % (float(editObj.GetValue()) * 100 / total if total > 0 else 0))
self.totSizer.Layout()
if event is not None:
event.Skip()
DamagePattern.getInstance().saveChanges(p)
示例5: setAsPattern
def setAsPattern(self, fitID, ammo):
if fitID is None:
return
sDP = DamagePattern.getInstance()
dp = sDP.getDamagePattern("Selected Ammo")
if dp is None:
dp = eos.types.DamagePattern()
dp.name = "Selected Ammo"
fit = eos.db.getFit(fitID)
for attr in ("em", "thermal", "kinetic", "explosive"):
setattr(dp, "%sAmount" % attr, ammo.getAttribute("%sDamage" % attr))
fit.damagePattern = dp
self.recalc(fit)
示例6: __init__
def __init__(self):
self.pattern = DamagePattern.getInstance().getDamagePattern("Uniform")
self.character = Character.getInstance().all5()
self.booster = False
self.dirtyFitIDs = set()
serviceFittingDefaultOptions = {
"useGlobalCharacter": False,
"useGlobalDamagePattern": False,
"defaultCharacter": self.character.ID,
"useGlobalForceReload": False,
"colorFitBySlot": False,
"rackSlots": True,
"rackLabels": True,
"compactSkills": True}
self.serviceFittingOptions = SettingsProvider.getInstance().getSettings(
"pyfaServiceFittingOptions", serviceFittingDefaultOptions)
示例7: importPatterns
def importPatterns(self, event):
text = fromClipboard()
if text:
sDP = DamagePattern.getInstance()
try:
sDP.importPatterns(text)
self.stNotice.SetLabel("Patterns successfully imported from clipboard")
except ImportError as e:
pyfalog.error(e)
self.stNotice.SetLabel(str(e))
except Exception as e:
msg = "Could not import from clipboard: unknown errors"
pyfalog.warning(msg)
pyfalog.error(e)
self.stNotice.SetLabel(msg)
finally:
self.entityEditor.refreshEntityList()
else:
self.stNotice.SetLabel("Could not import from clipboard")
示例8: DoDelete
def DoDelete(self, entity):
sDP = DamagePattern.getInstance()
sDP.deletePattern(entity)
示例9: DoCopy
def DoCopy(self, entity, name):
sDP = DamagePattern.getInstance()
copy = sDP.copyPattern(entity)
sDP.renamePattern(copy, name)
return copy
示例10: DoRename
def DoRename(self, entity, name):
sDP = DamagePattern.getInstance()
sDP.renamePattern(entity, name)
示例11: DoNew
def DoNew(self, name):
sDP = DamagePattern.getInstance()
return sDP.newPattern(name)
示例12: getEntitiesFromContext
def getEntitiesFromContext(self):
sDP = DamagePattern.getInstance()
choices = sorted(sDP.getDamagePatternList(), key=lambda p: p.name)
return [c for c in choices if c.name != "Selected Ammo"]
示例13: exportPatterns
def exportPatterns(self, event):
sDP = DamagePattern.getInstance()
toClipboard(sDP.exportPatterns())
self.stNotice.SetLabel("Patterns exported to clipboard")