Property | Type | Description | |
---|---|---|---|
equippedItem | int | ||
gold | int | ||
itemCount | int>.Dictionary | ||
items | List |
Method | Description | |
---|---|---|
AddItem ( object name, int number ) : void |
Used to add items to the inventory
|
|
Attack ( ) : float |
Returns the float attack value of the equipped item
|
|
Awake ( ) : void | ||
Cooldown ( ) : float |
Returns the cooldown/swingSpeed attribute of the equipped item
|
|
DropItem ( object obj ) : void |
Executes the Drop() method on the object passed if it exists in the inventory
|
|
GetItem ( string name ) : object |
Returns the item object from the inventory matching the name passed, defaulting to null
|
|
HasItem ( object obj ) : bool |
Returns boolean whether the object passed exists in the inventory
|
|
Range ( ) : float |
Returns the range attribute of the equipped item
|
|
RemoveItem ( object name, int number ) : bool |
Used to remove items from the inventory, returning a boolean value of the successfulness
|
|
RemoveItem ( string name, int number ) : bool | ||
ResetInv ( ) : void |
Clears all inventory data, then saves to disk
|
|
UpdateInv ( ) : void | ||
UseItem ( object obj ) : void |
Executes the Use() method on the object passed if it exits in the inventory
|
|
addGold ( int amount ) : void |
Adds the integer amount to the player's gold quantity
|
|
compareItems ( object obj1, object obj2 ) : bool | ||
equipItem ( object obj ) : void |
Equips the object passed if it exists in the inventory
|
|
getEquipped ( ) : object |
Returns the currently equipped item, defaulting to Hands
|
|
hasEnoughGold ( int amount ) : bool |
Returns whether the player has more than the amount specified of gold
|
|
removeGold ( int amount ) : bool |
Removes the integer amount from the player's gold if possible, doing nothing if not, returning a boolean value of it's success
|
Method | Description | |
---|---|---|
AddObject ( object obj, int number ) : void |
Used internally to deal with adding objects to the necessary lists and dictionaries
|
|
GetInventory ( ) : void |
Retrieves data from the stored data in the Json file
|
|
SaveInventory ( ) : void |
Saves data in the Json file save object, then writes the data to file
|
public static AddItem ( object name, int number ) : void | ||
name | object | |
number | int | |
return | void |
public static GetItem ( string name ) : object | ||
name | string | |
return | object |
public static RemoveItem ( object name, int number ) : bool | ||
name | object | |
number | int | |
return | bool |
public static RemoveItem ( string name, int number ) : bool | ||
name | string | |
number | int | |
return | bool |
public static compareItems ( object obj1, object obj2 ) : bool | ||
obj1 | object | |
obj2 | object | |
return | bool |
public static equipItem ( object obj ) : void | ||
obj | object | |
return | void |
public static hasEnoughGold ( int amount ) : bool | ||
amount | int | |
return | bool |
public static removeGold ( int amount ) : bool | ||
amount | int | |
return | bool |