first commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
namespace Core.Entities;
|
||||
|
||||
public class PartialTeam : Team
|
||||
{
|
||||
public IList<Student> OmittedStudents { get; }
|
||||
|
||||
public PartialTeam(string name, CompetitiveEvent @event, IList<Student> students, IList<Student> omittedStudents) : base(name, @event, students)
|
||||
{
|
||||
OmittedStudents = omittedStudents;
|
||||
}
|
||||
|
||||
public override Team CloneWithOmittedStudents(IEnumerable<Student> studentsToOmit)
|
||||
{
|
||||
var remainingStudents = Students.Where(s => !studentsToOmit.Contains(s)).ToList();
|
||||
var omittedStudents = OmittedStudents.Union(Students.Where(studentsToOmit.Contains)).Distinct().ToList();
|
||||
return new PartialTeam(Name, Event, remainingStudents, omittedStudents );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user