I have a custom object (the properties must be strings):
public class Nemesis
{
public String Dex_ID;
public String Value;
}
I have a certain function, which creates new instances of that object, adds values to them and then adds them to this List:
private List<Nemesis> _nemesisList;
public List<Nemesis> NemesisList
{
get { return _nemesisList; }
set { _nemesisList = value; }
}
Normally, I'd use this to check for existing things:
if (!NemesisList.Contains(nemesis))
{
NemesisList.Add(nemesis);
}
But this time I want to check if my List already contains a nemesis with the same nemesis.Dex_ID. How do I do that?