Exemple #1
0
        private void HandleMissedShot(Shot shot)
        {
            SetField(boardStateFields, shot.Position, new MissedShotField(shot.Position));
            SetField(playerFields, shot.Position, new MissedShotField(shot.Position));

            MissedShot?.Invoke(this, new MissedShotEventArgs(new ReadOnlyBoardContext(this)));
        }
Exemple #2
0
        public void MakeShot(int rowIndex, int columnIndex)
        {
            var usedGridPoint = _grid.UsedGridPoints.FirstOrDefault(point => point.X == rowIndex && point.Y == columnIndex);

            if (usedGridPoint != null)
            {
                usedGridPoint.HitGridPoint();

                CheckShot(rowIndex, columnIndex);
            }
            else
            {
                MissedShot?.Invoke(this, new EventArgs());
            }
        }