Пример #1
0
        //public IEnumerable<Game> SearchGame(string searchText, StringComparison comp)
        //{
        //    return this.GetAll().Where(g => g.ToString().Contains(searchText, comp));
        //}

        public void AddGoalToGame(Guid gameId, Guid playerId, int matchMinute)
        {
            var game = this.FindById(gameId);
            var goal = new Goal(new MatchMinute(matchMinute), DomainService.FindPlayerById(playerId).TeamId, playerId);

            game.Protocol.Goals.Add(goal);
        }
Пример #2
0
        public void AddYellowCardToGame(Guid gameId, Guid playerId, int matchMinute)
        {
            var game = this.FindById(gameId);
            var card = new Card(new MatchMinute(matchMinute), DomainService.FindPlayerById(playerId).TeamId, playerId, CardType.Yellow);

            game.Protocol.Cards.Add(card);
        }
Пример #3
0
        public void AddAssistToGame(Guid gameId, Guid playerId, int matchMinute)
        {
            var game   = this.FindById(gameId);
            var assist = new Assist(new MatchMinute(matchMinute), DomainService.FindPlayerById(playerId).TeamId, playerId);

            game.Protocol.Assists.Add(assist);
        }
Пример #4
0
 public IEnumerable <IExposableTeam> Search(string searchText, StringComparison comparison
                                            = StringComparison.InvariantCultureIgnoreCase)
 {
     return(this.GetAllTeams().Where(x =>
                                     x.Name.ToString().Contains(searchText, comparison) ||
                                     x.ArenaName.ToString().Contains(searchText, comparison) ||
                                     x.Email.Value.Contains(searchText, comparison) ||
                                     x.PlayerIds.Any(y => y != Guid.Empty &&
                                                     DomainService.FindPlayerById(y).Name.ToString().Contains(searchText, comparison))));
 }
Пример #5
0
 public IEnumerable <Game> Search(string searchText, StringComparison comparison
                                  = StringComparison.InvariantCultureIgnoreCase)
 {
     return(this.GetAll().Where(x => x.Id != Guid.Empty && x.SeriesId != Guid.Empty && x.HomeTeamId != Guid.Empty && x.AwayTeamId != Guid.Empty
                                &&
                                x.Location.ToString().Contains(searchText, comparison)
                                ||
                                x.MatchDate.ToString().Contains(searchText, comparison)
                                ||
                                DomainService.FindSeriesById(x.SeriesId).SeriesName.ToString().Contains(searchText, comparison)
                                ||
                                DomainService.FindTeamById(x.HomeTeamId).ToString().Contains(searchText, comparison)
                                ||
                                DomainService.FindTeamById(x.AwayTeamId).ToString().Contains(searchText, comparison)
                                ||
                                x.Protocol.HomeTeamActivePlayers.Any(y => DomainService.FindPlayerById(y).Name.ToString()
                                                                     .Contains(searchText, comparison)
                                                                     ||
                                                                     x.Protocol.AwayTeamActivePlayers.Any(z => DomainService.FindPlayerById(z).Name.ToString()
                                                                                                          .Contains(searchText, comparison)))));
 }
Пример #6
0
        public void AddPenaltyToGame(Guid gameId, Guid playerId, int matchMinute, bool isGoal)
        {
            var game = this.FindById(gameId);

            var penalty = new Penalty(new MatchMinute(matchMinute), playerId, isGoal, game, DomainService.FindPlayerById(playerId).TeamId);

            game.Protocol.Penalties.Add(penalty);
        }