public void HitTheBall(BallEventArgs e) { if (hitBallCallBack != null) { hitBallCallBack(e); } }
public void PlayBall() { Bat bat = ball.GetNewBat(); BallEventArgs ballEventArgs = new BallEventArgs(Trajectory, Distance); bat.HitTheBall(ballEventArgs); }
public void OnBallInPlay(BallEventArgs e) { EventHandler ballInPlay = BallInPlay; if (ballInPlay != null) { ballInPlay(this, e); } }
protected void OnBallInPlay(BallEventArgs e) { EventHandler <BallEventArgs> ballInPlay = BallInPlay; if (ballInPlay != null) { ballInPlay(this, e); } }
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(); } } }
void ball_BallInPlay(object sender, EventArgs e) { pitchNumber++; if (e is BallEventArgs) { BallEventArgs ballEventArgs = e as BallEventArgs; if (ballEventArgs.Distance > 400 && ballEventArgs.Trajectory > 80) { FanSays.Add("Pitch #" + pitchNumber + ": Home run! I`m going for the ball!"); } else { FanSays.Add("Pitch #" + pitchNumber + ":Woo-hoo!Yeah!"); } } }
public void PlayBall() { BallEventArgs ballEventArgs = new BallEventArgs(Trajectory, Distance); ball.OnBallInPlay(ballEventArgs); }