Storing a list of strings and arrays
<p>Is this a smart way of doing this?</p>

<p>So I'm making a class within my class called bankItemList and inside of that I have a string and an int. </p>

<pre><code>public List&lt;bankItemList&gt; listOfBankItems = new List&lt;bankItemList&gt;();
[Serializable]
public class bankItemList
{
    public int Stacks;
    public string Name;
    public bankItemList(string name, int amm)
    {
        Name = name;
        Stacks = amm;
    }
}
</code></pre>

<p>I then use a small function to add items to the List.</p>

<pre><code>public bool addItemToBankArray(string name, int amm)
{
    foreach (bankItemList i in listOfBankItems)
    {
        if (i.Name == name)
        {
            i.Stacks += amm;
            return true;
        }
    }
    bankItemList item = new bankItemList(name, amm);
    listOfBankItems.Add(item);
    return true;
}
</code></pre>

<p>Then I use another function for removing the items.</p>

<pre><code>public void bankItemClicked(GameObject obj)
{
        listOfBankItems.RemoveAt(bankitems.IndexOf(obj));
        bankitems.Remove(obj);
        Destroy(obj);
}
</code></pre>

<p>Of course this is trimmed down to only the core functionality. What I'm mainly asking, is creating a serializable class and adding that class to a list a good way of storing a string and an int that is "related" to each other.</p>