示例#1
0
文件: Storage.cs 项目: Nix7773/Dz2
 private void OnNewItemAdded(Student student)
 {
     if (student.AverageRating > 4.5)
     {
         ExelentStudentAdded?.Invoke(student);
     }
 }
示例#2
0
        private void OnNewItemAdded(Student student)
        {
            var max_index = 0;

            foreach (var s in _Items)
            {
                max_index = Math.Max(max_index, s.Id);
            }
            student.Id = max_index + 1;

            var random_group = __rnd.NextValue(_Groups.ToArray());

            student.GroupId = random_group.Id;

            if (student.AverageRating > 4.5)
            {
                ExelentStudentAdded?.Invoke(student);
            }
        }