예제 #1
0
 public void HitTheBall(BallEventArgs e)
 {
     if (hitBallCallback != null)
     {
         hitBallCallback(e);
     }
 }
예제 #2
0
 public void OnBallInPlay(BallEventArgs e)
 {
     if (BallInPlay != null)
     {
         BallInPlay(this, e);
     }
 }
예제 #3
0
        public void playBall_Click()
        {
            Bat bat = GetNewBat();

            BallEventArgs ballEventArgs = new BallEventArgs();
            bat.HitTheBall(ballEventArgs);
        }
예제 #4
0
        static void Main(string[] args)
        {
            Ball ball = new Ball();
            Pitcher pitcher = new Pitcher(ball);

            BallEventArgs ballEventArgs = new BallEventArgs(59, 94);

            ball.OnBallInPlay(ballEventArgs);
        }