Pokemon Unity
A pokemon clone made using Unity
Loading...
Searching...
No Matches
Inventory Class Reference

The Inventory class manages all Inventory-related logic More...

Inheritance diagram for Inventory:
[legend]
Collaboration diagram for Inventory:
[legend]

Public Member Functions

void Awake ()
 
List< ItemSlotGetSlotsByCategory (int categoryIndex)
 Get the List of ItemSlots for the specific category More...
 
ItemBase UseItem (int itemIndex, Pokemon selectedPokemon, int selectedCategory)
 Use an item More...
 
void RemoveItem (ItemBase item, int selectedCategory)
 Remove an item from the Inventory More...
 

Static Public Member Functions

static Inventory GetInventory ()
 

Properties

static List< string > ItemCategories [get, set]
 

Events

Action OnUpdated
 

Detailed Description

The Inventory class manages all Inventory-related logic

Definition at line 26 of file Inventory.cs.

Member Function Documentation

◆ Awake()

void Inventory.Awake ( )

Definition at line 43 of file Inventory.cs.

◆ GetInventory()

static Inventory Inventory.GetInventory ( )
static

Definition at line 96 of file Inventory.cs.

◆ GetSlotsByCategory()

List< ItemSlot > Inventory.GetSlotsByCategory ( int  categoryIndex)

Get the List of ItemSlots for the specific category

Parameters
categoryIndexThe index of the category

Definition at line 52 of file Inventory.cs.

◆ RemoveItem()

void Inventory.RemoveItem ( ItemBase  item,
int  selectedCategory 
)

Remove an item from the Inventory

Parameters
itemThe item to remove
selectedCategoryThe index of the selected category

Definition at line 84 of file Inventory.cs.

◆ UseItem()

ItemBase Inventory.UseItem ( int  itemIndex,
Pokemon  selectedPokemon,
int  selectedCategory 
)

Use an item

Parameters
itemIndexThe index of the item to use
selectedPokemonThe selected pokemon to use the item on
selectedCategoryThe index of the selected category

Definition at line 63 of file Inventory.cs.

Property Documentation

◆ ItemCategories

List<string> Inventory.ItemCategories
staticgetset
Initial value:
= new List<string>()
{
"ITEMS",
"POKEBALLS",
"TMs & HMs"
}

Definition at line 34 of file Inventory.cs.

Event Documentation

◆ OnUpdated

Action Inventory.OnUpdated

Definition at line 32 of file Inventory.cs.


The documentation for this class was generated from the following file: