![]() |
FCV Engine 0.1
A tool and framework for tutorials in game development
|
Component that holds all picked up items for player. More...
Public Member Functions | |
void | TryAddItem (string itemName, Item item) |
Tries to add item to inventory and if name already exists does nothing. | |
bool | TryRemoveItem (string itemName) |
Tries to remove item using item name. | |
bool | HasItem (string itemName) |
Checks if inventory has the item name specified. | |
Properties | |
Dictionary< string, Item > | InventoryItems = new() [get, set] |
Dictionary that holds all items with their names as key. | |
Component that holds all picked up items for player.
Definition at line 9 of file Inventory.cs.
bool HasItem | ( | string | itemName | ) |
Checks if inventory has the item name specified.
itemName | name of item |
Definition at line 45 of file Inventory.cs.
void TryAddItem | ( | string | itemName, |
Item | item ) |
Tries to add item to inventory and if name already exists does nothing.
itemName | name of item |
item | Item class reference |
Definition at line 26 of file Inventory.cs.
bool TryRemoveItem | ( | string | itemName | ) |
Tries to remove item using item name.
itemName | name of item |
Definition at line 36 of file Inventory.cs.