public FootballGame Create(GameId gameId) { var events = _eventCollector.CollectEvent(gameId); FootballGame game = new FootballGame(gameId); events.ForEach(game.AddEvent); _gameRepository.Save(game); return(game); }
private FootballGame GetFootballGame(GameId gameId) { FootballGame footballGame = _gameRepository.Find(gameId); if (footballGame == FootballGame.Null) { footballGame = Create(gameId); } return(footballGame); }
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); }
public TweetMatcher(IEnumerable <Tweet> tweets, FootballGame footballGame) { _tweets = tweets.ToList(); _footballGame = footballGame; }
public TimeLine(FootballGame game, IEnumerable <Tweet> tweets) { _tweets = tweets; Game = game; _elements = new List <Element>(); }