Add relevant service methods

This commit is contained in:
cncfanatics
2010-11-22 11:09:25 +01:00
parent 90d71d7eef
commit 391b8e6668
2 changed files with 21 additions and 9 deletions

2
eos

Submodule eos updated: 88e8d31f7e...bb86c96eca

View File

@@ -18,8 +18,8 @@
#===============================================================================
import eos.db
from eos.types import Fit, Ship, Character
from eos.types import Fleet as Fleet_
import copy
class Fleet(object):
instance = None
@@ -42,11 +42,23 @@ class Fleet(object):
return fleetList
def getFleet(self, ID):
f = Fleet_()
f.name = "Test"
f.leader = Fit()
f.leader.name = "FC"
f.leader.ship = Ship(eos.db.getItem("Damnation"))
f.character = Character("Moo")
f.calculateModifiedAttributes()
f = eos.db.getFleet(ID)
return f
def addFleet(self):
f = Fleet_()
eos.db.save(f)
return f
def renameFleet(self, fleet, newName):
fleet.name = newName
eos.db.commit()
def copyFleet(self, fleet):
newFleet = copy.deepcopy(fleet)
eos.db.save(newFleet)
return newFleet
def deleteFleet(self, fleet):
eos.db.remove(fleet)