pl/mbogusz3/invaders/model/Enemy.java
/**
	 * Destroy an enemy unit.
	 * @param row row of unit to destroy.
	 * @param column column of unit to destroy.
	 */
Destroy an enemy unit.
@param row row of unit to destroy.
@param column column of unit to destroy.
Destroy an enemy unit . @param row row of unit to destroy . @param column column of unit to destroy .
public void destroyUnit(int row, int column) {
		this.state[row][column] = false;
		if(column == this.firstColumn || column == this.lastColumn) {
			this.checkBorderColumn(column);
		}
		if(row == this.firstRow) {
			boolean anyLeft = false;
			for(int i = this.firstColumn; i <= this.lastColumn; i++) {
				if(this.state[row][i]) {
					anyLeft = true;
					break;
				}
			}
			if(!anyLeft) {
				this.firstRow--;
			}
		}
	}
public void destroyUnit ( int row , int column ) { this . state [ row ] [ column ] = false ; if ( column == this . firstColumn || column == this . lastColumn ) { this . checkBorderColumn ( column ) ; } if ( row == this . firstRow ) { boolean anyLeft = false ; for ( int i = this . firstColumn ; i <= this . lastColumn ; i ++ ) { if ( this . state [ row ] [ i ] ) { anyLeft = true ; break ; } } if ( ! anyLeft ) { this . firstRow -- ; } } }
Destroy an enemy unit.
Destroy an enemy unit .