Esempio n. 1
0
 public Pupil(Pupil pupil)
 {
     this.FirstName = pupil.FirstName;
     this.LastName = pupil.LastName;
     this.Level = pupil.Level;
     this.AvatarKey = pupil.AvatarKey;
 }
Esempio n. 2
0
        public Pupil GetRandomPupil(ushort level, Pupil currentlySelected)
        {
            Pupil result = null;

            if (level == 0)
            {
                result = this.Pupils.Where(p => currentlySelected == null || !p.Equals(currentlySelected)).NextRandom();
            }
            else
            {
                var potentials = this.Pupils.Where(p => (currentlySelected == null || !p.Equals(currentlySelected)) && p.Level == level);
                if (potentials.Count() == 0)
                {
                    result = null;
                }
                else
                {
                    result = potentials.NextRandom();
                }
            }

            return(result);
        }
 private void DeletePupil(Pupil pupil)
 {
     pupil.Parent.Pupils.Remove(pupil);
 }
Esempio n. 4
0
        public Pupil GetRandomPupil(ushort level, Pupil currentlySelected)
        {
            Pupil result = null;
            if (level == 0)
            {
                result = this.Pupils.Where(p => currentlySelected == null || !p.Equals(currentlySelected)).NextRandom();
            }
            else
            {
                var potentials = this.Pupils.Where(p => (currentlySelected == null || !p.Equals(currentlySelected)) && p.Level == level);
                if (potentials.Count() == 0)
                {
                    result = null;
                }
                else
                {
                    result = potentials.NextRandom();
                }
            }

            return result;
        }