package fr.univamu.progav.td5; public abstract class Character { protected int healthPoints; public Character(int initialHealth) { this.healthPoints = initialHealth; } // TODO add health points public boolean isAlive() { // TODO if (healthPoints > 0) { return true ; // Le personnage est vivant si les points de vie sont supérieurs à 0 } return false; } protected int getHealth() { // TODO return healthPoints; // Retourne les points de vie } protected void reduceHealth(int amount) { // TODO healthPoints -= amount; // Réduit les points de vie if (healthPoints < 0) { healthPoints = 0; // S'assure que les points de vie ne sont pas négatifs } } protected void setHealth(int health) { // TODO healthPoints = health; // Définit les points de vie } public abstract Blow attack(); public abstract void defend(Blow blow); public abstract void specialAction(); }