private void Init(IEnumerable <Event> events) { _gamePlayStates = new List <GamePlayState>(); _gameId = events.First().GameId; _homeTeamAdvantage = TeamAdvantage.Even; _scoreBoard = new ScoreBoard(); _penaltyBox = new PenaltyBox(_gameId); }
private void HandleGoalsThisSecond(IList <PlayEvent> eventsThatStartThisSecond, int second) { foreach (var playEvent in eventsThatStartThisSecond.Goals()) { if (playEvent.IsGoal) { _scoreBoard.AddGoal(playEvent.HomeTeam); _homeTeamAdvantage = _scoreBoard.HomeTeamAdvantage; } Log(playEvent, second); if (playEvent.IsPowerPlayGoal) { _penaltyBox.HandlePowerPlayGoal(playEvent); } } }
private void HandleGoalsThisSecond(IList<PlayEvent> eventsThatStartThisSecond, int second) { foreach (var playEvent in eventsThatStartThisSecond.Goals()) { if (playEvent.IsGoal) { _scoreBoard.AddGoal(playEvent.HomeTeam); _homeTeamAdvantage = _scoreBoard.HomeTeamAdvantage; } Log(playEvent, second); if (playEvent.IsPowerPlayGoal) { _penaltyBox.HandlePowerPlayGoal(playEvent); } } }
private void Init(IEnumerable<Event> events) { _gamePlayStates = new List<GamePlayState>(); _gameId = events.First().GameId; _homeTeamAdvantage = TeamAdvantage.Even; _scoreBoard = new ScoreBoard(); _penaltyBox = new PenaltyBox(_gameId); }