예제 #1
0
 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;
 }
예제 #2
0
 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;
 }