public void PlayBall() { var ballEventArgs = new BallEventArgs(Trajectory, Distance); var bat = ball.GetNewBat(); bat.HitTheBall(ballEventArgs); }
protected void OnBallInPlay(BallEventArgs e) { var ballInPlay = BallInPlay; if (ballInPlay == null) { return; } ballInPlay(this, e); }
private string DetermineText(BallEventArgs ballEventArgs) { if (ballEventArgs.Distance <= 400) { return(ScreamAndYell()); } if (ballEventArgs.Trajectory <= 30) { return(ScreamAndYell()); } return(TryToCatchBall()); }
private string DetermineText(BallEventArgs ballEventArgs) { if (ballEventArgs.Distance >= 95) { return(CoverFirstBase()); } if (ballEventArgs.Trajectory >= 60) { return(CoverFirstBase()); } return(CatchBall()); }