FCV Engine 0.1
A tool and framework for tutorials in game development
Loading...
Searching...
No Matches
ItemDatabase Class Reference

Scriptable object to hold all items assigned in editor to make ItemName property field to work properly Designed to make the string comparison easier. More...

Inheritance diagram for ItemDatabase:

Public Member Functions

List< string > GetAllItemNames ()
 Gets all item names in list.
 
string GetName (int index)
 Gets the name of a certain index in list.
 
void UpdateName (int index, string itemName)
 Updates the name of specified index in database.
 
bool HasItem (string itemName)
 returns true if the itemname is already in database
 
void AddItem (string itemName)
 Tries to add item to database with itemName, gives error if item name already exists in database.
 
void ClearItems ()
 Removes all items from database.
 

Detailed Description

Scriptable object to hold all items assigned in editor to make ItemName property field to work properly Designed to make the string comparison easier.

Definition at line 8 of file ItemDatabase.cs.

Member Function Documentation

◆ AddItem()

void AddItem ( string itemName)

Tries to add item to database with itemName, gives error if item name already exists in database.

Parameters
itemName

Definition at line 61 of file ItemDatabase.cs.

◆ GetAllItemNames()

List< string > GetAllItemNames ( )

Gets all item names in list.

Returns
list of strings with all names

Definition at line 16 of file ItemDatabase.cs.

◆ GetName()

string GetName ( int index)

Gets the name of a certain index in list.

Parameters
indexindex of item
Returns
the name of the item

Definition at line 26 of file ItemDatabase.cs.

◆ HasItem()

bool HasItem ( string itemName)

returns true if the itemname is already in database

Parameters
itemNamename of item
Returns
return true if item exists, false if not

Definition at line 52 of file ItemDatabase.cs.

◆ UpdateName()

void UpdateName ( int index,
string itemName )

Updates the name of specified index in database.

Parameters
indexindex of item
itemNamenew name of the item

Definition at line 36 of file ItemDatabase.cs.


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