CarteLieu possède désormais ses propres pioches
This commit is contained in:
@ -10,12 +10,13 @@ import personnage.CartePersonnage;
|
||||
|
||||
public class Joueur {
|
||||
private GestionnaireEquipements gestionnaireEquipements;
|
||||
|
||||
private String nom;
|
||||
private boolean revele;
|
||||
private Plateau plateau;
|
||||
private CartePersonnage cartePersonnage;
|
||||
private Equipe equipe;
|
||||
private CarteLieu carteLieu;
|
||||
|
||||
|
||||
// map keys
|
||||
public static final String PLAYER_HP = "hp";
|
||||
@ -79,8 +80,10 @@ public class Joueur {
|
||||
}
|
||||
|
||||
public List<Joueur> getJoueursAdjacents() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
|
||||
List<Joueur> joueurs = this.carteLieu.getJoueursAdjacents();
|
||||
joueurs.remove(this);
|
||||
return joueurs;
|
||||
}
|
||||
|
||||
public Equipement[] getEquipements() {
|
||||
@ -98,11 +101,6 @@ public class Joueur {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void piocher() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void attaquer(Joueur j2, int attaqueDice) {
|
||||
|
||||
int blessure = evaluerImmunite(j2)*(this.evaluerAttaque(j2) + attaqueDice);
|
||||
@ -155,9 +153,7 @@ public class Joueur {
|
||||
}
|
||||
|
||||
public void setCartePersonnage(CartePersonnage cp) {
|
||||
|
||||
this.cartePersonnage = cp;
|
||||
|
||||
}
|
||||
|
||||
public void setEquipe(Equipe equipe) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package main;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Stack;
|
||||
|
||||
import carte.CartePiochable;
|
||||
@ -9,7 +10,13 @@ public class Pioche<T extends Type> {
|
||||
|
||||
private Stack<CartePiochable<T>> cartesPiochables;
|
||||
|
||||
|
||||
public Pioche(List<CartePiochable<T>> cartesPiochables) {
|
||||
super();
|
||||
this.cartesPiochables = new Stack<CartePiochable<T>>();
|
||||
this.cartesPiochables.addAll(cartesPiochables);
|
||||
melanger();
|
||||
}
|
||||
|
||||
public void melanger()
|
||||
{
|
||||
Collections.shuffle(cartesPiochables);
|
||||
|
@ -23,13 +23,7 @@ public class Plateau {
|
||||
|
||||
private Map<String, Integer> stats;
|
||||
|
||||
|
||||
private Pioche<TypeLumiere> piocheLumiere;
|
||||
private Pioche<TypeTenebre> piocheTenebre;
|
||||
private Pioche<TypeVision> piocheVision;
|
||||
|
||||
|
||||
|
||||
|
||||
public Plateau(List<Joueur> joueurs) {
|
||||
this.joueurs = joueurs;
|
||||
this.lieux = new ArrayList<>();
|
||||
@ -54,8 +48,8 @@ public class Plateau {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void fairePiocher(Joueur joueur, Type type) {
|
||||
|
||||
public void piocher(Joueur joueur, Type type) {
|
||||
|
||||
}
|
||||
|
||||
public void déplacerJoueur(Joueur joueur, int indexLieu) {
|
||||
@ -70,7 +64,6 @@ public class Plateau {
|
||||
|
||||
joueur1.attaquer(joueur2,attaque);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -86,8 +79,6 @@ public class Plateau {
|
||||
return (int) Math.floor(Math.random() * 3)+1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int rollDices4() {
|
||||
return Math.abs(roll4() - roll4());
|
||||
}
|
||||
|
Reference in New Issue
Block a user