Esempio n. 1
0
        private void Init(IEnumerable <Event> events)
        {
            _gamePlayStates = new List <GamePlayState>();

            _gameId = events.First().GameId;

            _homeTeamAdvantage = TeamAdvantage.Even;
            _scoreBoard        = new ScoreBoard();
            _penaltyBox        = new PenaltyBox(_gameId);
        }
Esempio n. 2
0
        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);
                }
            }
        }
Esempio n. 3
0
        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);
                }
            }
        }
Esempio n. 4
0
        private void Init(IEnumerable<Event> events)
        {
            _gamePlayStates = new List<GamePlayState>();

            _gameId = events.First().GameId;

            _homeTeamAdvantage = TeamAdvantage.Even;
            _scoreBoard = new ScoreBoard();
            _penaltyBox = new PenaltyBox(_gameId);
        }