Add some functionality to implantSet service, and get editor working correctly with implant editor view

This commit is contained in:
blitzmann
2016-03-20 12:49:29 -04:00
parent c1653c5f2e
commit 80e47d5157
4 changed files with 49 additions and 7 deletions

View File

@@ -351,10 +351,12 @@ class Character(object):
implant = eos.types.Implant(eos.db.getItem(itemID))
char.implants.append(implant)
eos.db.commit()
def removeImplant(self, charID, implant):
char = eos.db.getCharacter(charID)
char.implants.remove(implant)
eos.db.commit()
def getImplants(self, charID):
char = eos.db.getCharacter(charID)

View File

@@ -39,6 +39,21 @@ class ImplantSets():
def getImplantSet(self, name):
return eos.db.getImplantSet(name)
def getImplants(self, setID):
set = eos.db.getImplantSet(setID)
return set.implants
def addImplant(self, setID, itemID):
set = eos.db.getImplantSet(setID)
implant = eos.types.Implant(eos.db.getItem(itemID))
set.implants.append(implant)
eos.db.commit()
def removeImplant(self, setID, implant):
set = eos.db.getImplantSet(setID)
set.implants.remove(implant)
eos.db.commit()
def newSet(self):
p = eos.types.ImplantSet()
p.name = ""