Esempio n. 1
0
        private void OnBoardClick(object sender, BoardCellClickEventArgs e)
        {
            if (PastShots.ContainsKey(new Point(e.X, e.Y)))
            {
                return;
            }

            ShotTargetChosen(e.X, e.Y);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 private bool IsValidShot(Point p)
 {
     return(!PastShots.ContainsKey(p) && new Rect(0, 0, 10, 10).Contains(p));
 }