public Pupil(Pupil pupil) { this.FirstName = pupil.FirstName; this.LastName = pupil.LastName; this.Level = pupil.Level; this.AvatarKey = pupil.AvatarKey; }
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); }
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; }