00001 00002 ''' 00003 InventoryItem.py: Item and Inventory item related common code 00004 11/07/2010 gsk 00005 ''' 00006 00007 class Item(): 00008 00009 def __init__(self): 00010 self.typeID = None 00011 self.itemClass = None 00012 self.dProperties = {} 00013 00014 00015 class InventoryItem(): 00016 00017 def __init__(self, ID): 00018 self.typeID=ID # type+serial form the world unique item ID 00019 self.itemSerial=0 00020 self.parent = None # tuple (typeID,itemSerial) identifying the paren object (if any) 00021 00022 class InventoryContainer(InventoryItem): 00023 00024 def __init__(self, ID): 00025 InventoryItem.__init__(self, ID) 00026 self.isRoot = False # is this a root container (only those can contain other containers) 00027 self.parent = None # parent container 00028 self.numSlots = 4 # default to 4 slots 00029
1.7.1