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 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; } }
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; }