Esempio n. 1
0
 private bool HasCourse(IClone clone, LearningCourse course)
 {
     foreach (var crs in clone.Learned)
     {
         if (crs.ID == course.ID)
         {
             return(true);
         }
     }
     return(false);
 }
Esempio n. 2
0
        public void Learn(uint id, LearningCourse course)
        {
            IClone clone = GetClone(id);

            if (clone == null)
            {
                return;
            }

            if (!HasCourse(clone, course))
            {
                clone.Learned.Push(course);
                clone.RolledBack.Clear();

                Console.WriteLine("Clone {0}: learned course {1}", id, course.ID);
            }
        }