Gem.getName C# (CSharp) Method

getName() public method

public getName ( ) : string
return string
    public string getName()
    {
        return gemName;
    }

Usage Example

Exemplo n.º 1
0
    //Attempts to add a gem to the inventory
    //This function assumes the array is sorted
    //Returns 0 if inventory is full
    public int addGem(Gem gem)
    {
        if(numGems <= MAX_STORED_GEMS)
        {
            storedGems.Add(gem);
            numGems++;
            Debug.Log("Stored " + gem.getName() + " in index " + numGems);
            sortGems();
        }
        else
        {
            return 0; //Give error message
        }

        return 1;
    }