public void HitTheBall(BallEventArgs e) { if (hitBallCallback != null) { hitBallCallback(e); } }
public void OnBallInPlay(BallEventArgs e) { if (BallInPlay != null) { BallInPlay(this, e); } }
public void playBall_Click() { Bat bat = GetNewBat(); BallEventArgs ballEventArgs = new BallEventArgs(); bat.HitTheBall(ballEventArgs); }
static void Main(string[] args) { Ball ball = new Ball(); Pitcher pitcher = new Pitcher(ball); BallEventArgs ballEventArgs = new BallEventArgs(59, 94); ball.OnBallInPlay(ballEventArgs); }