private IList <Movie> GetMoviesGroup(GroupDto groupOne, GroupDto groupTwo) { return(new List <Movie> { _tiebreaker.Apply(new List <Movie> { groupOne.Movies.First(), groupTwo.Movies.Last() }).First(), _tiebreaker.Apply(new List <Movie> { groupTwo.Movies.First(), groupOne.Movies.Last() }).First() }); }
public void Execute(CompetitionBizDto dto) { var disputeResult = _tiebreaker.Apply(dto.Finals.Movies).ToList(); dto.CompetitionResult = new CompetitionResultDto { FirstPlace = disputeResult.First(), SecondPlace = disputeResult.Last(), ThirdPlace = GetThirdPlace(dto.SemiFinals, disputeResult.First()) }; }
public IList <GroupDto> Dispute(IEnumerable <GroupDto> groups) { return(groups.Select ( x => new GroupDto { Name = x.Name, Movies = _tiebreaker.Apply(x.Movies).Take(AmountMovies) } ).ToList()); }