Commit 5ff6e635 authored by babablaze's avatar babablaze

add extends between Pion and PionSecour, PionAssimilation. Add in Plateau a...

add extends between Pion and PionSecour, PionAssimilation. Add in Plateau a list for positon of PionSecour and Jetons Artemia
parent 7c000e03
package fr.univnantes.alma.game.composant.Pion;
public class Pion {
public abstract class Pion {
protected int position;
......@@ -16,10 +16,6 @@ public class Pion {
this.position = position;
}
public void decrementation(){
this.position--;
}
@Override
public String toString() {
return "Pion{" +
......
package fr.univnantes.alma.game.composant.Pion;
public class PionAssimilation extends Pion{
public PionAssimilation(int position) {
super(position);
}
public void decrementation() {
this.position--;
}
@Override
public String toString() {
return "PionAssimilation{" +
"position=" + super.position +
'}';
}
}
package fr.univnantes.alma.game.composant.Pion;
public class PionSecours extends Pion{
public PionSecours(int position) {
super(position);
}
public void decrementation() {
this.position--;
}
@Override
public String toString() {
return "PionSecours{" +
"position=" + super.position +
'}';
}
}
package fr.univnantes.alma.game.composant;
import fr.univnantes.alma.game.composant.Carte.*;
import fr.univnantes.alma.game.composant.Jeton.Jeton;
import fr.univnantes.alma.game.composant.Jeton.SymboleJeton;
import fr.univnantes.alma.game.composant.Pion.Pion;
import fr.univnantes.alma.game.composant.Pion.PionAssimilation;
import fr.univnantes.alma.game.composant.Pion.PionSecours;
import fr.univnantes.alma.game.database.Lieux.*;
import fr.univnantes.alma.game.database.Survie.*;
import fr.univnantes.alma.game.database.Traque.*;
......@@ -14,8 +18,9 @@ public class Plateau {
private ArrayList<CarteLieu> reserve;
private ArrayList<CarteSurvie> piocheSurvie;
private ArrayList<CarteTraque> piocheTraque;
private Pion pionAssimilation;
private Pion pionSecours;
private PionAssimilation pionAssimilation;
private PionSecours pionSecours;
private ArrayList<> plateauPion;
public Plateau(int numberPlayer){
//initialisation plateau Creature
......@@ -123,9 +128,13 @@ public class Plateau {
this.piocheTraque.add(new Virus());
this.piocheTraque.add(new ZoneInterdite());
//Initialisation pion Assimilation
this.pionAssimilation = new Pion(numberPlayer);
//Initialisation pion Secours
this.pionSecours = new Pion(numberPlayer);
this.pionAssimilation = new PionAssimilation(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));
}
}
public ArrayList<CarteLieu> getPlateauCarte() {
......@@ -144,7 +153,11 @@ public class Plateau {
return piocheTraque;
}
public Pion getPionAssimilation() {
public ArrayList getPlateauPion() {
return plateauPion;
}
public PionAssimilation getPionAssimilation() {
return pionAssimilation;
}
......@@ -152,7 +165,7 @@ public class Plateau {
this.pionAssimilation.setPosition(newPosition);
}
public Pion getPionSecours() {
public PionSecours getPionSecours() {
return pionSecours;
}
......@@ -169,6 +182,7 @@ public class Plateau {
", piocheTraque=" + piocheTraque +
", pionAssimilation=" + pionAssimilation +
", pionSecours=" + pionSecours +
", plateauPion=" + plateauPion +
'}';
}
}
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