dblessDogmaItem.py (1533B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\dogma\items\dblessDogmaItem.py 2 from __future__ import absolute_import 3 from .chargeDogmaItem import ChargeDogmaItem 4 from ccpProfile import TimedFunction 5 import dogma.const as dogmaConst 6 import sys 7 8 class DBLessDogmaItem(ChargeDogmaItem): 9 10 @TimedFunction('DBLessDogmaItem::__init__') 11 def __init__(self, dogmaLocation, item, eveCfg, clientIDFunc): 12 ChargeDogmaItem.__init__(self, dogmaLocation, item, eveCfg, clientIDFunc) 13 self.fittedItems = {} 14 self.subLocations = {} 15 16 def Load(self, _, __): 17 pass 18 19 def Unload(self): 20 ChargeDogmaItem.Unload(self) 21 self.dogmaLocation.RemoveSubLocationFromLocation(self.itemID) 22 23 def SetLocation(self, locationID, locationDogmaItem, flagID): 24 ChargeDogmaItem.SetLocation(self, locationID, locationDogmaItem, flagID) 25 locationDogmaItem.SetSubLocation(self.itemID) 26 locationDogmaItem.MarkDirty() 27 28 def UnsetLocation(self, locationDogmaItem): 29 ChargeDogmaItem.UnsetLocation(self, locationDogmaItem) 30 locationDogmaItem.RemoveSubLocation(self.itemID) 31 32 def OnItemLoaded(self): 33 locationID, flagID, typeID = self.itemID 34 try: 35 quantity = self.dogmaLocation.GetQuantityFromCache(locationID, flagID) 36 self.attributes[dogmaConst.attributeQuantity].SetBaseValue(quantity) 37 except KeyError: 38 sys.exc_clear() 39 finally: 40 ChargeDogmaItem.OnItemLoaded(self)