private void OnBoardClick(object sender, BoardCellClickEventArgs e) { if (PastShots.ContainsKey(new Point(e.X, e.Y))) { return; } ShotTargetChosen(e.X, e.Y); }
private void ShootRandom() { int x; int y; do { x = _rnd.Next(0, 10); y = _rnd.Next(0, 10); } while (PastShots.ContainsKey(new Point(x, y))); ShotTargetChosen(x, y); }
private bool IsValidShot(Point p) { return(!PastShots.ContainsKey(p) && new Rect(0, 0, 10, 10).Contains(p)); }