Пример #1
0
        public static void RandomMatingPair(out BloodLineMember a, out BloodLineMember b)
        {
            var knownFails = new List <BloodLineMember>();
            var random     = new Random();
            var shuffed    = Population.OrderBy(x => random.Next());

            a = null;
            b = null;
            foreach (var popA in shuffed)
            {
                if (popA.PastMates.Count() > 0)
                {
                    if (popA.Children.Count() < 5)
                    {
                        a = popA;
                        b = popA.PastMates.First();
                        return;
                    }
                }
                else
                {
                    foreach (var popB in shuffed)
                    {
                        if (popA != popB && !BloodLineManager.HasRelation(popA, popB))
                        {
                            a = popA;
                            b = popB;
                        }
                    }
                }
            }
            ;
        }
Пример #2
0
 public static bool CanMate(BloodLineMember a, BloodLineMember b)
 {
     return(!BloodLineManager.HasRelation(a, b));
 }