예제 #1
0
        public void PlayBall()
        {
            var ballEventArgs = new BallEventArgs(Trajectory, Distance);
            var bat           = ball.GetNewBat();

            bat.HitTheBall(ballEventArgs);
        }
예제 #2
0
        protected void OnBallInPlay(BallEventArgs e)
        {
            var ballInPlay = BallInPlay;

            if (ballInPlay == null)
            {
                return;
            }
            ballInPlay(this, e);
        }
예제 #3
0
 private string DetermineText(BallEventArgs ballEventArgs)
 {
     if (ballEventArgs.Distance <= 400)
     {
         return(ScreamAndYell());
     }
     if (ballEventArgs.Trajectory <= 30)
     {
         return(ScreamAndYell());
     }
     return(TryToCatchBall());
 }
예제 #4
0
 private string DetermineText(BallEventArgs ballEventArgs)
 {
     if (ballEventArgs.Distance >= 95)
     {
         return(CoverFirstBase());
     }
     if (ballEventArgs.Trajectory >= 60)
     {
         return(CoverFirstBase());
     }
     return(CatchBall());
 }