Commit bed0818f authored by babablaze's avatar babablaze
Browse files

delete Extends of Pion, fix Plateau

parent 072a4272
package fr.univnantes.alma.game.composant.Pion;
public abstract class Pion {
public class Pion {
protected int position;
......@@ -8,9 +8,13 @@ public abstract class Pion {
this.position = position;
}
public abstract int getPosition();
public int getPosition(){
return position;
}
public abstract void setPosition(int position);
public void setPosition(int position){
this.position = position;
}
@Override
public String toString() {
......
package fr.univnantes.alma.game.composant.Pion;
public class PionAssimilation extends Pion {
public PionAssimilation(int position) {
super(position);
}
@Override
public int getPosition() {
return super.position;
}
@Override
public void setPosition(int position) {
super.position = 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);
}
@Override
public int getPosition() {
return super.position;
}
@Override
public void setPosition(int position) {
super.position = position;
}
@Override
public String toString() {
return "PionSecours{" +
"position=" + super.position +
'}';
}
}
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.Pion.PionAssimilation;
import fr.univnantes.alma.game.composant.Pion.PionSecours;
import fr.univnantes.alma.game.composant.Pion.Pion;
import fr.univnantes.alma.game.database.Lieux.*;
import java.util.ArrayList;
......@@ -11,10 +9,12 @@ import java.util.ArrayList;
public class Plateau {
private ArrayList<Carte> plateauCarte;
private PionAssimilation pionAssimilation;
private PionSecours pionSecours;
private ArrayList<Carte> reserve;
private Pion pionAssimilation;
private Pion pionSecours;
public Plateau(int numberPlayer){
//initialisation plateau Creature
this.plateauCarte = new ArrayList<>();
this.plateauCarte.add(new Antre());
this.plateauCarte.add(new Jungle());
......@@ -25,14 +25,46 @@ public class Plateau {
this.plateauCarte.add(new Epave());
this.plateauCarte.add(new Abri());
this.plateauCarte.add(new Source());
this.pionAssimilation = new PionAssimilation(numberPlayer);
this.pionSecours = new PionSecours(numberPlayer);
this.plateauCarte.add(new Artefact());
//Initialisation reserve pioche
this.reserve = new ArrayList<>();
if(numberPlayer==1){
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());
}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());
}
}else{
for(int i=0; i<3; 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());
}
}
//Initialisation pion Assimilation
this.pionAssimilation = new Pion(numberPlayer);
//Initialisation pion Secours
this.pionSecours = new Pion(numberPlayer);
}
public ArrayList<Carte> getPlateauCarte() {
return plateauCarte;
}
public ArrayList<Carte> getReserve() {
return reserve;
}
public PionAssimilation getPionAssimilation() {
return pionAssimilation;
}
......
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