Пример #1
0
        public void Sink()
        {
            List <SeaCell> cells;

            lock (Cells)
            {
                cells = Cells.ToList();
            }
            foreach (var cell in cells)
            {
                cell.SetState(SeaCellState.SHIP_SUNK);
            }
            OnShipSunk?.Invoke(this);
        }
Пример #2
0
        //private void Ship_OnCellStateChanged(SeaCell cell)
        //{
        //    OnShipCellStateChanged?.Invoke(cell.Ship, cell);
        //}

        private void Ship_OnShipSunk(Ship ship)
        {
            OnShipSunk?.Invoke(ship);
        }