public AnimalRecord FindAnimal(AnimalRecordKey key) { AnimalRecord result; if (animalDictionary.TryGetValue(key, out result)) { return(result); } else { return(null); } }
public override bool Equals(System.Object o) { if (o == null) { return(false); } if (!(o is AnimalRecordKey)) { return(false); } AnimalRecordKey pair = (AnimalRecordKey)o; return(this.ThingDef == pair.ThingDef && this.Gender == pair.Gender); }
public SelectedAnimal FindSelectedAnimal(AnimalRecordKey key) { return(Animals.FirstOrDefault((SelectedAnimal animal) => { return Object.Equals(animal.Key, key); })); }