示例#1
0
        public void OnBallInPlay(BallEventArgs e)
        {
            EventHandler ballInPlay = BallInPlay;

            if (ballInPlay != null)
            {
                ballInPlay(this, e);
            }
        }
示例#2
0
        private void ball_BallInPlay(object sender, EventArgs e)
        {
            pitchNumber++;

            BallEventArgs ballEventArgs = e as BallEventArgs;

            if ((ballEventArgs.Distance > 400) && (ballEventArgs.Trajectory > 30))
            {
                GrabGloveCatchBall();
            }
            else
            {
                ScreamAndShout();
            }
        }
示例#3
0
 private void ball_BallInPlay(object sender, EventArgs e)
 {
     pitchNumber++;
     if (e is BallEventArgs)
     {
         BallEventArgs ballEventArgs = e as BallEventArgs;
         if ((ballEventArgs.Distance < 95) && (ballEventArgs.Trajectory < 60))
         {
             CatchBall();
         }
         else
         {
             CoverFirstBase();
         }
     }
 }
示例#4
0
        public void PlayBall()
        {
            BallEventArgs ballEventArgs = new BallEventArgs(Trajectory, Distance);

            ball.OnBallInPlay(ballEventArgs);
        }