Commit 9310d321 authored by babablaze's avatar babablaze

fix list of Jeton Artemia

parent 6ec8ca0d
......@@ -20,11 +20,11 @@ public class Plateau {
private ArrayList<CarteTraque> piocheTraque;
private PionAssimilation pionAssimilation;
private PionSecours pionSecours;
private ArrayList<> plateauPion;
private ArrayList<Jeton> plateauPion;
public Plateau(int numberPlayer){
//initialisation plateau Creature
this.plateauCarte = new ArrayList<CarteLieu>();
this.plateauCarte = new ArrayList<>();
this.plateauCarte.add(new Antre());
this.plateauCarte.add(new Jungle());
this.plateauCarte.add(new Riviere());
......@@ -129,11 +129,16 @@ public class Plateau {
this.piocheTraque.add(new ZoneInterdite());
//Initialisation pion Assimilation
this.pionAssimilation = new PionAssimilation(numberPlayer);
//Initialisation pion Secours
this.pionSecours = new PionSecours(19-(7-numberPlayer));
//initialisation plateau de Pion
this.plateauPion = new ArrayList<>();
this.plateauPion.add(7-numberPlayer, new PionSecours(7-numberPlayer));
for(int i = 0; i<6; i++){
this.plateauPion.add(7+i, new Jeton(SymboleJeton.ARTEMIA));
for(int i = 0; i<19; i++){
if(i<13 || i==19){
this.plateauPion.add(null);
}else{
this.plateauPion.add(13+i, new Jeton(SymboleJeton.ARTEMIA));
}
}
}
......@@ -153,7 +158,7 @@ public class Plateau {
return piocheTraque;
}
public ArrayList getPlateauPion() {
public ArrayList<Jeton> getPlateauPion() {
return plateauPion;
}
......
......@@ -8,38 +8,56 @@ public class PionTest {
@Test
public void testGetPosition(){
Pion pion = new Pion(7);
PionAssimilation pion = new PionAssimilation(7);
int nombre = 7;
int nombre2 = 3;
assertEquals(pion.getPosition(), nombre);
assertEquals(nombre, pion.getPosition());
assertNotEquals(nombre2, pion.getPosition());
PionSecours pionS = new PionSecours(7);
assertEquals(nombre, pionS.getPosition());
assertNotEquals(nombre2, pionS.getPosition());
}
@Test
public void testSetPosition(){
Pion pion = new Pion(7);
PionAssimilation pion = new PionAssimilation(7);
pion.setPosition(3);
int nombre = 7;
int nombre2 = 3;
assertEquals(pion.getPosition(), nombre2);
assertNotEquals(nombre, pion.getPosition());
PionSecours pionS = new PionSecours(7);
pionS.setPosition(3);
assertEquals(nombre2, pionS.getPosition());
assertNotEquals(nombre, pionS.getPosition());
}
@Test
public void testDecrementation(){
Pion pion = new Pion(7);
PionAssimilation pion = new PionAssimilation(7);
pion.decrementation();
PionSecours pion2 = new PionSecours(7);
pion2.decrementation();
assertEquals(6, pion.getPosition());
assertEquals(6, pion2.getPosition());
}
@Test
public void testToString(){
Pion pion = new Pion(7);
String message = "Pion{" + "position=" + pion.getPosition() + '}';
PionAssimilation pion = new PionAssimilation(7);
String message = "PionAssimilation{" + "position=" + pion.getPosition() + '}';
assertEquals(message, pion.toString());
PionSecours pion2 = new PionSecours(7);
String message2 = "PionSecours{" + "position=" + pion.getPosition() + '}';
assertEquals(message2, pion2.toString());
}
}
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