Commit 9c13269d authored by babablaze's avatar babablaze
Browse files

add enum Couleur, add attribute dans Artefact, fix plateau and test Pion

parent 453d198f
package fr.univnantes.alma.game.composant.Carte;
public enum CouleurCarte {
BLEU,
ROUGE,
VERT,
JAUNE
}
package fr.univnantes.alma.game.composant;
import fr.univnantes.alma.game.composant.Carte.Carte;
import fr.univnantes.alma.game.composant.Carte.CarteLieu;
import fr.univnantes.alma.game.composant.Carte.*;
import fr.univnantes.alma.game.composant.Pion.Pion;
import fr.univnantes.alma.game.database.Lieux.*;
import fr.univnantes.alma.game.database.Survie.*;
import fr.univnantes.alma.game.database.Traque.*;
import java.util.ArrayList;
......@@ -11,6 +12,8 @@ public class Plateau {
private ArrayList<CarteLieu> plateauCarte;
private ArrayList<CarteLieu> reserve;
private ArrayList<CarteSurvie> piocheSurvie;
private ArrayList<CarteTraque> piocheTraque;
private Pion pionAssimilation;
private Pion pionSecours;
......@@ -26,7 +29,7 @@ public class Plateau {
this.plateauCarte.add(new Epave());
this.plateauCarte.add(new Abri());
this.plateauCarte.add(new Source());
this.plateauCarte.add(new Artefact());
this.plateauCarte.add(new Artefact(CouleurCarte.BLEU));
//Initialisation reserve pioche
this.reserve = new ArrayList<>();
if(numberPlayer==1){
......@@ -34,14 +37,14 @@ public class Plateau {
this.reserve.add(new Epave());
this.reserve.add(new Abri());
this.reserve.add(new Source());
this.reserve.add(new Artefact());
this.reserve.add(new Artefact(CouleurCarte.BLEU));
}else if(numberPlayer==2 || numberPlayer==3){
for(int i=0; i<2; i++){
this.reserve.add(new Abri());
this.reserve.add(new Epave());
this.reserve.add(new Abri());
this.reserve.add(new Source());
this.reserve.add(new Artefact());
this.reserve.add(new Artefact(CouleurCarte.BLEU));
}
}else{
for(int i=0; i<3; i++){
......@@ -49,9 +52,76 @@ public class Plateau {
this.reserve.add(new Epave());
this.reserve.add(new Abri());
this.reserve.add(new Source());
this.reserve.add(new Artefact());
this.reserve.add(new Artefact(CouleurCarte.BLEU));
}
}
//Initialisation pioche carte de Survie
this.piocheSurvie.add(new Adrenaline());
this.piocheSurvie.add(new Alerte());
this.piocheSurvie.add(new Amplificateur());
this.piocheSurvie.add(new Brouillage());
this.piocheSurvie.add(new Cavale());
this.piocheSurvie.add(new Detecteur());
this.piocheSurvie.add(new Drone());
this.piocheSurvie.add(new Entrave());
this.piocheSurvie.add(new Equipement());
this.piocheSurvie.add(new Esquive());
this.piocheSurvie.add(new FaussePiste());
this.piocheSurvie.add(new Hologramme());
this.piocheSurvie.add(new Leurre());
this.piocheSurvie.add(new Mimetisme());
this.piocheSurvie.add(new Navette());
this.piocheSurvie.add(new Planques());
this.piocheSurvie.add(new Portail());
this.piocheSurvie.add(new Ralliement());
this.piocheSurvie.add(new Refuge());
this.piocheSurvie.add(new Regeneration());
this.piocheSurvie.add(new Resistance());
this.piocheSurvie.add(new Retraite());
this.piocheSurvie.add(new Riposte());
this.piocheSurvie.add(new Sacrifice());
this.piocheSurvie.add(new SecondSouffle());
this.piocheSurvie.add(new SixiemeSens());
this.piocheSurvie.add(new SystemeD());
this.piocheSurvie.add(new Tenacite());
this.piocheSurvie.add(new Vaccin());
this.piocheSurvie.add(new VolteFace());
this.piocheSurvie.add(new Vortex());
//Initialisation pioche carte de Traque
this.piocheTraque.add(new Acharnement());
this.piocheTraque.add(new Angoisse());
this.piocheTraque.add(new Anticipation());
this.piocheTraque.add(new Cataclysme());
this.piocheTraque.add(new ChampDeForce());
this.piocheTraque.add(new Clone());
this.piocheTraque.add(new Deploiement());
this.piocheTraque.add(new Desespoir());
this.piocheTraque.add(new Detour());
this.piocheTraque.add(new Domination());
this.piocheTraque.add(new Effroi());
this.piocheTraque.add(new Emprise());
this.piocheTraque.add(new FailleTemporelle());
this.piocheTraque.add(new Gargantua());
this.piocheTraque.add(new Harcelement());
this.piocheTraque.add(new Hurlements());
this.piocheTraque.add(new Inertie());
this.piocheTraque.add(new Interferences());
this.piocheTraque.add(new Intuition());
this.piocheTraque.add(new Magnetisme());
this.piocheTraque.add(new Mirage());
this.piocheTraque.add(new Mutation());
this.piocheTraque.add(new Psychose());
this.piocheTraque.add(new Reminiscence());
this.piocheTraque.add(new Reperage());
this.piocheTraque.add(new SablesMouvants());
this.piocheTraque.add(new SoifDeSang());
this.piocheTraque.add(new Stase());
this.piocheTraque.add(new Telephatie());
this.piocheTraque.add(new Tornade());
this.piocheTraque.add(new Toxine());
this.piocheTraque.add(new Ubiquite());
this.piocheTraque.add(new Virus());
this.piocheTraque.add(new ZoneInterdite());
//Initialisation pion Assimilation
this.pionAssimilation = new Pion(numberPlayer);
//Initialisation pion Secours
......@@ -66,6 +136,14 @@ public class Plateau {
return reserve;
}
public ArrayList<CarteSurvie> getPiocheSurvie() {
return piocheSurvie;
}
public ArrayList<CarteTraque> getPiocheTraque() {
return piocheTraque;
}
public Pion getPionAssimilation() {
return pionAssimilation;
}
......@@ -87,6 +165,8 @@ public class Plateau {
return "Plateau{" +
"plateauCarte=" + plateauCarte +
", reserve=" + reserve +
", piocheSurvie=" + piocheSurvie +
", piocheTraque=" + piocheTraque +
", pionAssimilation=" + pionAssimilation +
", pionSecours=" + pionSecours +
'}';
......
package fr.univnantes.alma.game.database.Lieux;
import fr.univnantes.alma.game.composant.Carte.CarteLieu;
import fr.univnantes.alma.game.composant.Carte.CouleurCarte;
public class Artefact extends CarteLieu {
public Artefact() {
private CouleurCarte couleur;
public Artefact(CouleurCarte color) {
super("L'Artefact", "...", 10);
this.couleur = color;
}
}
......@@ -3,4 +3,5 @@ package fr.univnantes.alma.common;
import org.junit.jupiter.api.Test;
public class GameJoinRequestTest {
}
......@@ -10,13 +10,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class CarteTest {
@BeforeEach
public void init(){
Carte carteLieux = new Abri();
Carte carteSurvie = new Adrenaline();
Carte carteTraque = new Acharnement();
}
@org.junit.Test
public void testGetId(){
CarteLieu carteLieux = new Abri();
......
......@@ -13,7 +13,7 @@ public class PionTest {
int nombre2 = 3;
assertEquals(pion.getPosition(), nombre);
assertNotEquals(pion.getPosition(), nombre2);
assertNotEquals(nombre2, pion.getPosition());
}
@Test
......@@ -24,7 +24,15 @@ public class PionTest {
int nombre = 7;
int nombre2 = 3;
assertEquals(pion.getPosition(), nombre2);
assertNotEquals(pion.getPosition(), nombre);
assertNotEquals(nombre, pion.getPosition());
}
@Test
public void testDecrementation(){
Pion pion = new Pion(7);
pion.decrementation();
assertEquals(6, pion.getPosition());
}
@Test
......@@ -32,6 +40,6 @@ public class PionTest {
Pion pion = new Pion(7);
String message = "Pion{" + "position=" + pion.getPosition() + '}';
assertEquals(pion.toString(), message);
assertEquals(message, pion.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