public HeroFieldDef GetField(string name) { foreach (DefinitionId definitionId in this.Fields) { HeroFieldDef heroFieldDef = definitionId.Definition as HeroFieldDef; if (heroFieldDef != null && heroFieldDef.Name == name) { return(heroFieldDef); } } foreach (DefinitionId definitionId in this.ParentClasses) { HeroClassDef heroClassDef = definitionId.Definition as HeroClassDef; if (heroClassDef != null) { HeroFieldDef field = heroClassDef.GetField(name); if (field != null) { return(field); } } } return((HeroFieldDef)null); }
public HeroFieldDef GetField(string name) { foreach (DefinitionId id in this.Fields) { HeroFieldDef definition = id.Definition as HeroFieldDef; if ((definition != null) && (definition.Name == name)) { return(definition); } } foreach (DefinitionId id2 in this.ParentClasses) { HeroClassDef def2 = id2.Definition as HeroClassDef; if (def2 != null) { HeroFieldDef field = def2.GetField(name); if (field != null) { return(field); } } } return(null); }