//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; }