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

Class DamagePattern

service/damagePattern.py:31–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30
31class DamagePattern:
32 instance = None
33
34 @classmethod
35 def getInstance(cls):
36 if cls.instance is None:
37 cls.instance = DamagePattern()
38
39 return cls.instance
40
41 @staticmethod
42 def getUserDamagePatternList():
43 return eos.db.getDamagePatternList()
44
45 @staticmethod
46 def getBuiltinDamagePatternList():
47 return es_DamagePattern.getBuiltinList()
48
49 @staticmethod
50 def getDamagePattern(name):
51 return eos.db.getDamagePattern(name)
52
53 @staticmethod
54 def newPattern(name):
55 p = es_DamagePattern(0, 0, 0, 0)
56 p.rawName = name
57 eos.db.save(p)
58 return p
59
60 @staticmethod
61 def renamePattern(p, newName):
62 p.rawName = newName
63 eos.db.save(p)
64
65 @staticmethod
66 def deletePattern(p):
67 eos.db.remove(p)
68
69 @staticmethod
70 def copyPattern(p):
71 newP = copy.deepcopy(p)
72 eos.db.save(newP)
73 return newP
74
75 @staticmethod
76 def saveChanges(p):
77 eos.db.save(p)
78
79 def importPatterns(self, text):
80 imports, num = es_DamagePattern.importPatterns(text)
81 lenImports = len(imports)
82
83 if lenImports == 0:
84 raise ImportError("No patterns found for import")
85 if lenImports != num:
86 raise ImportError("%d patterns imported from clipboard; %d had errors" % (num, num - lenImports))
87
88 def exportPatterns(self):

Callers 2

_getAutoResistsFunction · 0.90
getInstanceMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected