public int GetIntValue(string name) { foreach (var r in valueReferences) { if (r.Name == name) return r.GetIntValue(); } throw new NotFoundException("Couldn't find ValueReference corresponding to \"" + name + "\"."); }