public Person getRelevantParent(Person actPerson, SexType sexType) { Person iPerson = null; do { iPerson = this.people[rand.Next(0, People.N)]; } while ((iPerson.Equals(actPerson)) || (!iPerson.SexType.Equals(sexType))); return iPerson; }
public Person getRelevantParent(Person actPerson, Person parent) { Person iPerson = null; do { iPerson = this.people[rand.Next(0, People.N)]; } while ((iPerson.Equals(actPerson)) || ((parent != null ? iPerson.Equals(parent) : false))); return iPerson; }