Skip to content
Snippets Groups Projects
Commit 08522f24 authored by LOI Leo's avatar LOI Leo
Browse files

ajout Fabrique Personnage

parent 3c6e0531
No related branches found
No related tags found
No related merge requests found
public class FabriqueGuerisseur extends FabriquePersonnage{
@Override
public Personnage createPerso() {
return new Guerisseur();
}
}
public class FabriqueGuerrier extends FabriquePersonnage{
@Override
public Personnage createPerso() {
return new Guerrier();
}
}
public abstract class FabriquePersonnage {
public abstract Personnage createPerso();
}
public class FabriqueRoi extends FabriquePersonnage{
@Override
public Personnage createPerso() {
return new Roi();
}
}
public class FabriqueSorcier extends FabriquePersonnage{
@Override
public Personnage createPerso() {
return new Sorcier();
}
}
......@@ -2,6 +2,10 @@ public class Guerisseur extends Personnage {
private int sagesse;
private String isWhat = "Guerisseur";
public Guerisseur(){
super();
}
public Guerisseur(int pv, int niv, String nom, Arme arme, int sagesse) {
super(pv, niv, nom, arme);
this.sagesse = sagesse;
......
......@@ -2,6 +2,10 @@ public class Guerrier extends Personnage {
private int force;
private String isWhat = "Guerrier";
public Guerrier(){
super();
}
public Guerrier(int pv, int niv, String nom, Arme arme, int force) {
super(pv, niv, nom, arme);
this.force = force;
......
......@@ -5,6 +5,10 @@ public abstract class Personnage implements EPersonnage {
Arme arme;
String isWhat;
public Personnage(){
}
public Personnage(int pv, int niv, String nom, Arme arme){
this.pointsDeVie = pv;
this.niveau = niv;
......
......@@ -10,6 +10,9 @@ public class Roi extends Personnage {
this.royaume = royaume;
}
public Roi(){
super();
}
@Override
public int accept(Visiteur visitor) {
return visitor.visiter(this);
......
......@@ -2,6 +2,10 @@ public class Sorcier extends Personnage {
private int intelligence;
private String isWhat = "Sorcier";
public Sorcier(){
super();
}
public Sorcier(int pv, int niv, String nom, Arme arme, int intelligence) {
super(pv, niv, nom, arme);
this.intelligence = intelligence;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment