public PokemonStatModifer this[PokemonStatModifierType pStatType] { get { // We get the 1st occurence of the desired PokemonStatType. foreach (var item in this) { if (item.Type == pStatType) { return(item); } } // No occurence found. return(null); } set { var statToSet = this[pStatType]; if (statToSet != null) { statToSet = value; } } }
public PokemonStatModifer(PokemonStatModifierType pType, int pCurrentValue) { Type = pType; CurrentValue = pCurrentValue; }