Beispiel #1
0
        protected void Fire(int row, int col, Player otherPlayer)
        {
            int        damagedIndex;
            bool       isSunk;
            SquareType newType = otherPlayer.FiredAt(row, col, out damagedIndex, out isSunk);

            EnemyGrid[row][col].ShipIndex = damagedIndex;

            if (isSunk)
            {
                EnemySunk(damagedIndex);
            }
            else
            {
                EnemyGrid[row][col].Type = newType;
            }
        }
Beispiel #2
0
        protected void Strzelaj(int row, int col, Player otherPlayer)
        {
            //incrase number of shots and set number of enemy units
            _shots++;
            MainWindow._mainWindow.UpdateTb(_shots, _enemyUnits);

            int            damagedIndex;
            bool           isDestroyed;
            TypPowierzchni newType = otherPlayer.FiredAt(row, col, out damagedIndex, out isDestroyed);

            EnemyGrid[row][col].SquareIndex = damagedIndex;

            if (isDestroyed)
            {
                EnemyDestroyed(damagedIndex);
            }
            else
            {
                EnemyGrid[row][col].Type = newType;
            }
        }
Beispiel #3
0
        protected void Fire(int row, int col, Player otherPlayer)
        {
            int damagedIndex;
            bool isSunk;
            SquareType newType = otherPlayer.FiredAt(row, col, out damagedIndex, out isSunk);
            EnemyGrid[row][col].ShipIndex = damagedIndex;

            if (isSunk)
                EnemySunk(damagedIndex);
            else
                EnemyGrid[row][col].Type = newType;
        }
        protected void Fire(int row, int col, Player otherPlayer)
        {
            //incrase number of shots and set number of enemy units
            _shots++;
            MainWindow._mainWindow.UpdateTb(_shots, _enemyUnits);

            int damagedIndex;
            bool isDestroyed;
            SquareType newType = otherPlayer.FiredAt(row, col, out damagedIndex, out isDestroyed);
            EnemyGrid[row][col].SquareIndex = damagedIndex;

            if (isDestroyed)
                EnemyDestroyed(damagedIndex);
            else
                EnemyGrid[row][col].Type = newType;
        }