Commit 40921cc6 authored by Guillaume Dewisme's avatar Guillaume Dewisme

fix/endurance not abstract

parent 5f9d3f98
...@@ -4,12 +4,6 @@ public abstract class Entity { ...@@ -4,12 +4,6 @@ public abstract class Entity {
private int damage; private int damage;
private int pvMax; private int pvMax;
private int pv; private int pv;
private int endurance;
private static final int MAX_ENDURANCE = 3;
public Entity(){
this.endurance = MAX_ENDURANCE;
}
public void heal(){ public void heal(){
...@@ -40,13 +34,6 @@ public abstract class Entity { ...@@ -40,13 +34,6 @@ public abstract class Entity {
this.pv = pv; this.pv = pv;
} }
public int getEndurance() {
return this.endurance;
}
public void setEndurance(int endurance) {
this.endurance = endurance;
}
public boolean isAlive(){ public boolean isAlive(){
return (this.pv > 0); return (this.pv > 0);
......
...@@ -3,15 +3,23 @@ package org.example; ...@@ -3,15 +3,23 @@ package org.example;
public class Player extends Entity { public class Player extends Entity {
private String name; private String name;
private SpecialAbility specialAbility; private SpecialAbility specialAbility;
private int endurance;
private static final int MAX_ENDURANCE = 3;
public Player(String name, SpecialAbility specialAbility) { public Player(String name, SpecialAbility specialAbility) {
super(); super();
this.name = name; this.name = name;
this.specialAbility = specialAbility; this.specialAbility = specialAbility;
this.endurance = MAX_ENDURANCE;
this.setPvMax(100); this.setPvMax(100);
this.setPv(this.getPvMax()); this.setPv(this.getPvMax());
this.setDamage(5); this.setDamage(5);
} }
public void attackEnnemy(){
--this.endurance;
//implement when Ennemy class is created
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment