Exemplo n.º 1
0
        public FootballGame Create(GameId gameId)
        {
            var          events = _eventCollector.CollectEvent(gameId);
            FootballGame game   = new FootballGame(gameId);

            events.ForEach(game.AddEvent);
            _gameRepository.Save(game);
            return(game);
        }
Exemplo n.º 2
0
        private FootballGame GetFootballGame(GameId gameId)
        {
            FootballGame footballGame = _gameRepository.Find(gameId);

            if (footballGame == FootballGame.Null)
            {
                footballGame = Create(gameId);
            }
            return(footballGame);
        }
Exemplo n.º 3
0
        private List <Tweet> GetTweets(GameId gameId, string hashTag, FootballGame footballGame)
        {
            if (_tweetRepository.IsTweetOfGameCollected(gameId))
            {
                return(_tweetRepository.GetGameTweets(gameId));
            }

            var tweets = _tweetConnector.CollectTweets(footballGame, hashTag).ToList();

            tweets.ForEach(t => _tweetRepository.AddEvent(gameId, t));
            return(tweets);
        }
Exemplo n.º 4
0
 public TweetMatcher(IEnumerable <Tweet> tweets, FootballGame footballGame)
 {
     _tweets       = tweets.ToList();
     _footballGame = footballGame;
 }
Exemplo n.º 5
0
 public TimeLine(FootballGame game, IEnumerable <Tweet> tweets)
 {
     _tweets   = tweets;
     Game      = game;
     _elements = new List <Element>();
 }