Adding Fighter Support CREST
This commit is contained in:
@@ -46,6 +46,7 @@ INV_FLAGS = {
|
|||||||
|
|
||||||
INV_FLAG_CARGOBAY = 5
|
INV_FLAG_CARGOBAY = 5
|
||||||
INV_FLAG_DRONEBAY = 87
|
INV_FLAG_DRONEBAY = 87
|
||||||
|
INV_FLAG_FIGHTER = 158
|
||||||
|
|
||||||
class Port(object):
|
class Port(object):
|
||||||
"""Service which houses all import/export format functions"""
|
"""Service which houses all import/export format functions"""
|
||||||
@@ -131,6 +132,15 @@ class Port(object):
|
|||||||
item['type']['name'] = ''
|
item['type']['name'] = ''
|
||||||
fit['items'].append(item)
|
fit['items'].append(item)
|
||||||
|
|
||||||
|
for fighter in ofit.fighters:
|
||||||
|
item = nested_dict()
|
||||||
|
item['flag'] = INV_FLAG_FIGHTER
|
||||||
|
item['quantity'] = fighter.amountActive
|
||||||
|
item['type']['href'] = "%sinventory/types/%d/"%(eve._authed_endpoint, fighter.item.ID)
|
||||||
|
item['type']['id'] = fighter.item.ID
|
||||||
|
item['type']['name'] = fighter.item.name
|
||||||
|
fit['items'].append(item)
|
||||||
|
|
||||||
return json.dumps(fit)
|
return json.dumps(fit)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -196,6 +206,9 @@ class Port(object):
|
|||||||
c = Cargo(item)
|
c = Cargo(item)
|
||||||
c.amount = module['quantity']
|
c.amount = module['quantity']
|
||||||
f.cargo.append(c)
|
f.cargo.append(c)
|
||||||
|
elif module['flag'] == INV_FLAG_FIGHTER:
|
||||||
|
fighter = Fighter(item)
|
||||||
|
f.fighters.append(fighter)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
m = Module(item)
|
m = Module(item)
|
||||||
|
|||||||
Reference in New Issue
Block a user