public bool Accept( IReservation[] reservations, IReservation candidate, ITable[] tables, TimeSpan seatingDuration) { var sameDayReservations = new SameIntervalReservationFilter() .Filter(reservations, candidate, seatingDuration); var assignedTables = new BestFitTableAssigner() .Assign(sameDayReservations, tables); var leftTables = tables.Except(assignedTables); return(leftTables.Any(t => candidate.CanFit(t))); }
public bool Accept( IReservation[] reservations, IReservation candidate, ITable[] tables, TimeSpan seatingDuration) { var sameDayReservations = new SameIntervalReservationFilter() .Filter(reservations, candidate, seatingDuration); var assignedTables = new AlternativeConfigurationsTableAssigner() .Assign(sameDayReservations, tables); var leftTables = tables.Except(assignedTables); var leftTblsGroups = new TableConfigurationsGenerator() .Generate(leftTables); return(leftTblsGroups.Any(t => candidate.CanFit(t))); }