Example #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);
        }
Example #2
0
        private FootballGame GetFootballGame(GameId gameId)
        {
            FootballGame footballGame = _gameRepository.Find(gameId);

            if (footballGame == FootballGame.Null)
            {
                footballGame = Create(gameId);
            }
            return(footballGame);
        }
Example #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);
        }
Example #4
0
 public TweetMatcher(IEnumerable <Tweet> tweets, FootballGame footballGame)
 {
     _tweets       = tweets.ToList();
     _footballGame = footballGame;
 }
Example #5
0
 public TimeLine(FootballGame game, IEnumerable <Tweet> tweets)
 {
     _tweets   = tweets;
     Game      = game;
     _elements = new List <Element>();
 }