2021-04-29 14:45:18 +00:00
|
|
|
package uulm.teamname.marvelous.gamelibrary.entities;
|
2021-04-29 14:40:23 +00:00
|
|
|
|
2021-04-29 14:45:18 +00:00
|
|
|
import uulm.teamname.marvelous.gamelibrary.IntVector2;
|
2021-04-29 14:40:23 +00:00
|
|
|
|
|
|
|
/** Represents a rock entity on the map.
|
|
|
|
*/
|
|
|
|
public class Rock extends Entity {
|
|
|
|
/** The maximum hp of the rock.
|
|
|
|
*/
|
|
|
|
public final int maxHP;
|
|
|
|
|
|
|
|
/** The current hp of the rock.
|
|
|
|
*/
|
|
|
|
private int hp;
|
|
|
|
|
|
|
|
/** Constructs a new {@link Rock}.
|
|
|
|
* @param id The {@link EntityID} of the rock.
|
|
|
|
* @param position The position of the rock.
|
|
|
|
* @param hp The hp of the rock.
|
|
|
|
*/
|
|
|
|
public Rock(EntityID id, IntVector2 position, int hp) {
|
|
|
|
super(id, position);
|
|
|
|
this.maxHP = hp;
|
|
|
|
this.hp = hp;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getHp() {
|
|
|
|
return hp;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void decreaseHp(int damage) {
|
|
|
|
this.hp -= damage;
|
|
|
|
}
|
|
|
|
}
|