Esempio n. 1
0
        private void doROEError(ERROR_TYPE _gravity, Game _game, PositionPlayer _batter, DefensiveAttributes.POSITION _posCommitingError)
        {
            _game.CommitError();

            bool doDeep = false;

            switch (_gravity)
            {
                case ERROR_TYPE.DEEP_FIELDING:
                    _game.GetLog().addEvent(_game.CurrentHalfInning, _game.HomeTeamAtBat, _batter.FirstName + " reaches on an outfield fielding error by " + _game.GetDefenderFirstName(_posCommitingError) + "!");
                    doDeep = true;
                    break;
                case ERROR_TYPE.DEEP_THROWING:
                    _game.GetLog().addEvent(_game.CurrentHalfInning, _game.HomeTeamAtBat, _batter.FirstName + " reaches on an outfield throwing error by " + _game.GetDefenderFirstName(_posCommitingError) + "!");
                    doDeep = true;
                    break;
                case ERROR_TYPE.SHORT_THROWING:
                    _game.GetLog().addEvent(_game.CurrentHalfInning, _game.HomeTeamAtBat, _batter.FirstName + " reaches on an infield throwing error by " + _game.GetDefenderFirstName(_posCommitingError) + "!");
                    doDeep = true;
                    break;
                case ERROR_TYPE.SHORT_FIELDING:
                    _game.GetLog().addEvent(_game.CurrentHalfInning, _game.HomeTeamAtBat, _batter.FirstName + " reaches on an infield fielding error by " + _game.GetDefenderFirstName(_posCommitingError) + "!");
                    doDeep = false;
                    break;
            }

            if (doDeep)
            {
                doDeepError(_game);
                _game.RunnerOnSecond = _batter;
            }
            else
            {
                doShortError(_game);
                _game.RunnerOnFirst = _batter;
            }
        }
Esempio n. 2
0
        private void doNonROEError(ERROR_TYPE _gravity, Game _game, DefensiveAttributes.POSITION _posCommitingError)
        {
            _game.CommitError();

            bool doDeep = false;

            switch (_gravity)
            {
                case ERROR_TYPE.DEEP_FIELDING:
                    _game.GetLog().addEvent(_game.CurrentHalfInning, _game.HomeTeamAtBat, "An outfield fielding error by " + _game.GetDefenderFirstName(_posCommitingError) + " allows the runners to advance!");
                    doDeep = true;
                    break;
                case ERROR_TYPE.DEEP_THROWING:
                    _game.GetLog().addEvent(_game.CurrentHalfInning, _game.HomeTeamAtBat, "An outfield throwing error by " + _game.GetDefenderFirstName(_posCommitingError) + " allows the runners to advance!");
                    doDeep = true;
                    break;
                case ERROR_TYPE.SHORT_THROWING:
                    _game.GetLog().addEvent(_game.CurrentHalfInning, _game.HomeTeamAtBat, "An infield throwing error by " + _game.GetDefenderFirstName(_posCommitingError) + " allows the runners to advance!");
                    doDeep = true;
                    break;
                case ERROR_TYPE.SHORT_FIELDING:
                    _game.GetLog().addEvent(_game.CurrentHalfInning, _game.HomeTeamAtBat, "An infield fielding error by " + _game.GetDefenderFirstName(_posCommitingError) + " allows the runners to advance!");
                    doDeep = false;
                    break;
                case ERROR_TYPE.DEEP_BOBBLE:
                    _game.GetLog().addEvent(_game.CurrentHalfInning, _game.HomeTeamAtBat, "A bobble by " + _game.GetDefenderFirstName(_posCommitingError) + " allows the runners to advance!");
                    doDeep = false;
                    break;
            }

            if (doDeep)
            {
                doDeepError(_game);
            }
            else
            {
                doShortError(_game);
            }
        }