pl/mbogusz3/invaders/model/Obstacles.java
/**
	 * Inflict damate to an obstacle.
	 * @param index index of obstacle to inflict damage to.
	 * @param damage damage to inflict.
	 */
Inflict damate to an obstacle.
@param index index of obstacle to inflict damage to.
@param damage damage to inflict.
Inflict damate to an obstacle . @param index index of obstacle to inflict damage to . @param damage damage to inflict .
public void damage(int index, int damage) {
		if(index < 0 || index > this.count) {
			return;
		}
		this.state[index] -= damage;
		if(this.state[index] < 0) {
			this.state[index] = 0;
		}
	}
public void damage ( int index , int damage ) { if ( index < 0 || index > this . count ) { return ; } this . state [ index ] -= damage ; if ( this . state [ index ] < 0 ) { this . state [ index ] = 0 ; } }
Inflict damate to an obstacle.
Inflict damate to an obstacle .