Nettoyage.
This commit is contained in:
parent
c847b7e82e
commit
85eec13349
@ -1,8 +1,5 @@
|
||||
package Cases;
|
||||
|
||||
/**
|
||||
* Created by : Amine
|
||||
*/
|
||||
public enum PointsCardinaux {
|
||||
N,
|
||||
NE,
|
||||
|
@ -1,8 +0,0 @@
|
||||
package Comportements;
|
||||
|
||||
public class ComportementAPiedAvecHache implements ComportementCombat {
|
||||
@Override
|
||||
public String combattre() {
|
||||
return "Par ma hache !";
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
package Comportements;
|
||||
|
||||
public interface ComportementCombat {
|
||||
String combattre();
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package Comportements;
|
||||
|
||||
public class ComportementCombatAvecCheval implements ComportementCombat {
|
||||
@Override
|
||||
public String combattre() {
|
||||
return "Huu ! Attaque";
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package Comportements;
|
||||
|
||||
public class ComportementCrier implements ComportementEmmetreSon {
|
||||
|
||||
@Override
|
||||
public String emmetreSon() {
|
||||
return "Bwaaaaaa";
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
package Comportements;
|
||||
|
||||
public class ComportementParlerCommeUnePrincesse implements ComportementEmmetreSon {
|
||||
|
||||
@Override
|
||||
public String emmetreSon() {
|
||||
return "La la la la la";
|
||||
}
|
||||
|
||||
}
|
@ -2,11 +2,8 @@ package Fabriques.Personnages;
|
||||
|
||||
import Observateur.Organisation;
|
||||
import Person.Arbitre;
|
||||
import Person.Chevalier;
|
||||
import Person.Fantasssin;
|
||||
import Person.JoueurDeChamp;
|
||||
import Person.Personnage;
|
||||
import Person.Princesse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
package Fabriques.Personnages;
|
||||
|
||||
import Observateur.Organisation;
|
||||
import Person.Chevalier;
|
||||
import Person.Fantasssin;
|
||||
import Person.Personnage;
|
||||
import Person.Princesse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -12,14 +9,15 @@ public class FabriquePersonnagesMoyenAge extends FabriquePersonnagesAbstraite {
|
||||
|
||||
@Override
|
||||
public ArrayList<Personnage> CreerPersonages(Organisation o) {
|
||||
Princesse p = new Princesse("Fiona");
|
||||
/* Princesse p = new Princesse("Fiona");
|
||||
Chevalier z = new Chevalier(o, "Zodiac");
|
||||
Fantasssin f = new Fantasssin(o, "Fantastic");
|
||||
|
||||
ArrayList<Personnage> liste = new ArrayList<Personnage>();
|
||||
liste.add(p);
|
||||
liste.add(z);
|
||||
liste.add(f);
|
||||
liste.add(f);*/
|
||||
ArrayList<Personnage> liste = new ArrayList<Personnage>();
|
||||
return liste;
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
package Person;
|
||||
|
||||
import Comportements.ComportementCombatAvecCheval;
|
||||
import Comportements.ComportementCrier;
|
||||
import Observateur.Organisation;
|
||||
|
||||
public class Chevalier extends Personnage {
|
||||
|
||||
|
||||
public Chevalier(Organisation etatMajor, String nom) {
|
||||
super(etatMajor, nom);
|
||||
this.comportementCombat = new ComportementCombatAvecCheval();
|
||||
this.comportementEmmetreSon = new ComportementCrier();
|
||||
}
|
||||
|
||||
public String getNom() {
|
||||
return "Chevalier " + this.nom + " à votre service";
|
||||
}
|
||||
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package Person;
|
||||
|
||||
import Comportements.ComportementAPiedAvecHache;
|
||||
import Comportements.ComportementCrier;
|
||||
import Observateur.Organisation;
|
||||
|
||||
public class Fantasssin extends Personnage {
|
||||
public Fantasssin(Organisation etatMajor, String nom) {
|
||||
super(etatMajor, nom);
|
||||
this.comportementCombat = new ComportementAPiedAvecHache();
|
||||
this.comportementEmmetreSon = new ComportementCrier();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNom() {
|
||||
return "Séraphin " + this.nom + ". A vos ordres";
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package Person;
|
||||
|
||||
import Cases.CaseAbstraite;
|
||||
import Comportements.ComportementCombat;
|
||||
import Comportements.ComportementEmmetreSon;
|
||||
import Composition.PersonnagesAbstraits;
|
||||
import Observateur.ObservateurAbstrait;
|
||||
@ -10,13 +9,11 @@ import Observateur.Organisation;
|
||||
public class Personnage extends PersonnagesAbstraits implements ObservateurAbstrait {
|
||||
protected CaseAbstraite caseCourante;
|
||||
protected String nom;
|
||||
protected ComportementCombat comportementCombat;
|
||||
protected ComportementEmmetreSon comportementEmmetreSon;
|
||||
protected eMode etatFonctionnement = eMode.ND;
|
||||
|
||||
protected Personnage(Organisation etatMajor, String nom) {
|
||||
this.nom = nom;
|
||||
this.comportementCombat = null;
|
||||
this.comportementEmmetreSon = null;
|
||||
|
||||
if (etatMajor != null)
|
||||
@ -27,26 +24,12 @@ public class Personnage extends PersonnagesAbstraits implements ObservateurAbstr
|
||||
return nom;
|
||||
}
|
||||
|
||||
public void setComportementCombat(ComportementCombat comportementCombat) {
|
||||
this.comportementCombat = comportementCombat;
|
||||
}
|
||||
|
||||
public void setComportementEmmetreSon(ComportementEmmetreSon comportementEmmetreSon) {
|
||||
this.comportementEmmetreSon = comportementEmmetreSon;
|
||||
}
|
||||
public String EmmetreSon() {
|
||||
return this.comportementEmmetreSon.emmetreSon();
|
||||
}
|
||||
|
||||
public String Combattre() {
|
||||
if (this.comportementCombat != null)
|
||||
return this.comportementCombat.combattre() + " \n" + this.getEtat();
|
||||
else {
|
||||
return "Ohhh, je suis trop faible pour combattre !";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void update(eMode comportement) {
|
||||
this.etatFonctionnement = comportement;
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
package Person;
|
||||
|
||||
import Comportements.ComportementParlerCommeUnePrincesse;
|
||||
|
||||
public class Princesse extends Personnage {
|
||||
|
||||
public Princesse(String nom) {
|
||||
super(null, nom);
|
||||
this.comportementEmmetreSon = new ComportementParlerCommeUnePrincesse();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNom() {
|
||||
return "Je suis " + this.nom + " princesse des princesses";
|
||||
}
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
import Comportements.ComportementCombat;
|
||||
import Comportements.ComportementEmmetreSon;
|
||||
import Fabriques.Scenario.FabriqueScenarioAbstraite;
|
||||
import Observateur.Organisation;
|
||||
import Person.Personnage;
|
||||
@ -26,14 +24,6 @@ public class SimulationJeu {
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public void changerComportementCombat(Personnage p, ComportementCombat c){
|
||||
p.setComportementCombat(c);
|
||||
}
|
||||
|
||||
public void changerComportementEmmetreSon(Personnage p, ComportementEmmetreSon c){
|
||||
p.setComportementEmmetreSon(c);
|
||||
}
|
||||
|
||||
public void creationPersonnages() {
|
||||
o = new Organisation();
|
||||
liste = f.CreerPersonnages(o);
|
||||
@ -42,7 +32,6 @@ public class SimulationJeu {
|
||||
public String emmetreUnSonTous() {
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (Personnage p: liste) {
|
||||
result.append(p.EmmetreSon());
|
||||
result.append(System.getProperty("line.separator"));
|
||||
}
|
||||
return result.toString();
|
||||
@ -51,7 +40,6 @@ public class SimulationJeu {
|
||||
public String lancerCombar() {
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (Personnage p: liste) {
|
||||
result.append(p.Combattre());
|
||||
result.append(System.getProperty("line.separator"));
|
||||
}
|
||||
return result.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user