Module MySpecialLists :: Class MY_InventoryList
[hide private]
[frames] | no frames]

Class MY_InventoryList

source code

class for the player's inventory with all needed methods

Instance Methods [hide private]
 
__init__(self) source code
 
__getitem__(self, name) source code
 
fillWithConfigValues(self)
sets the inventory with values from the config parser
source code
Boolean
useItem(self, item_name, add)
adds or remove an item from its list and the config parser
source code
 
addMerchItem(self, merch_name)
adds a merchandise item to the config parser
source code
Instance Variables [hide private]
List of List [[Integer, String, Integer], ...] inventoryList
the list that contains the players skill levels (health etc.).
Method Details [hide private]

useItem(self, item_name, add)

source code 

adds or remove an item from its list and the config parser

Parameters:
  • item_name (String) - the nameof the item that shall be used
  • add (Boolean) - True if an item was collected, False if item was used
Returns: Boolean
'True' if the item exists, else 'False'

addMerchItem(self, merch_name)

source code 

adds a merchandise item to the config parser

Parameters:
  • merch_name (String) - the name of the merhcandise item that was collected

Instance Variable Details [hide private]

inventoryList

the list that contains the players skill levels (health etc.). one skill => [number of dose, item name, lifetime]
Type:
List of List [[Integer, String, Integer], ...]