Skip to content
Snippets Groups Projects
Commit 3303186d authored by Maxime Wallart's avatar Maxime Wallart :speech_balloon:
Browse files

update

parent 84756715
No related branches found
No related tags found
No related merge requests found
......@@ -17,28 +17,16 @@ public class Main {
}*/
Plateau plateau = new Plateau();
<<<<<<< HEAD
int x = 11;
int y = 10;
=======
int x = 13;
int y = 23;
>>>>>>> 663e9463f07e3e309d4b27451be1390f7ac87d7e
plateau.getCase(x, y).setUnite(new Paysant(x, y, plateau, winner));
Affichage.affichage(plateau);
while(y<30) {
winner.getArmee().get(0).move(deplacement());
System.out.println('\n');
<<<<<<< HEAD
winner.getArmee().get(0).teleporte();
Affichage.affichage(plateau);
}
Menu();
=======
plateau.getCase(12, 0);
Affichage.affichage(plateau);
//Menu();
>>>>>>> 663e9463f07e3e309d4b27451be1390f7ac87d7e
}
public static void Menu () {
......
......@@ -9,10 +9,10 @@ public class Archer extends Unite{
public static final int ARMOR = 5;
public static final int DAMAGE = 5;
public static final char SYMBOL = 'A';
public static final int VISION = 2;
public Archer(int x, int y, Plateau plateau, Joueur joueur) {
super(x,y, plateau, SYMBOL, ARMOR, DAMAGE, joueur);
super(x,y, plateau, SYMBOL, ARMOR, DAMAGE, joueur, VISION);
}
@Override
......
......@@ -9,9 +9,10 @@ public class Chevalier extends Unite {
public static final int ARMOR = 10;
public static final int DAMAGE = 5;
public static final char SYMBOL = 'C';
public static final int VISION = 2;
public Chevalier(int x, int y, Plateau plateau, Joueur joueur) {
super(x,y, plateau, SYMBOL, ARMOR, DAMAGE, joueur);
super(x,y, plateau, SYMBOL, ARMOR, DAMAGE, joueur, VISION);
}
......
......@@ -9,9 +9,10 @@ public class Eclaireur extends Unite {
public static final int ARMOR = 1;
public static final int DAMAGE = 0;
public static final char SYMBOL = 'E';
public static final int VISION = 2;
public Eclaireur(int x, int y, Plateau plateau, Joueur joueur) {
super(x,y, plateau, SYMBOL, ARMOR, DAMAGE, joueur);
super(x,y, plateau, SYMBOL, ARMOR, DAMAGE, joueur, VISION);
}
......
......@@ -50,7 +50,7 @@ public class Paysant extends Unite{
sc.close();
return true;
}else {
//TODO:utiliser un systme de vrification d'entre globale
//TODO:utiliser un système de vérification d'entrée globale
System.out.println("ERROR");
}
......@@ -60,7 +60,7 @@ public class Paysant extends Unite{
}
public void combattre() {
//TODO: il faut d'abord regarder si une unit est prsente autour
//TODO: il faut d'abord regarder si une unité est présente autour
}
public void actionGivePA() {
......
......@@ -128,61 +128,50 @@ public abstract class Unite {
}
//à voir le type
public boolean move(char c) {
/*if(c=='s' && updatePosition(x+1,y))*/
if(c == 's') {
/*if (plateau.getCase(x+1,y).getUnite() != null) {
combat();
}*/
if (plateau.getCase(x+1,y).getUnite() != null || plateau.getCase(x+1, y).getUnite().getJoueur() != this.joueur) {
//combat();
}
if (updatePosition(x+1,y)) {
this.plateau.getCase(x, y).setUnite(null);
<<<<<<< HEAD
this.plateau.getCase(x, y).setType(Type.GRASS);
this.x+=1;
=======
updateDecouverte(this.plateau.getCase(x+1, y), this.vision);
>>>>>>> 663e9463f07e3e309d4b27451be1390f7ac87d7e
return true;
}
}
else if(c == 'd') {
if (updatePosition(x,y+1)) {
this.plateau.getCase(x, y).setUnite(null);
<<<<<<< HEAD
this.plateau.getCase(x, y).setType(Type.GRASS);
this.y+=1;
=======
updateDecouverte(this.plateau.getCase(x, y+1), this.vision);
>>>>>>> 663e9463f07e3e309d4b27451be1390f7ac87d7e
return true;
}
}
else if(c == 'q') {
if (updatePosition(x,y-1)) {
this.plateau.getCase(x, y).setUnite(null);
<<<<<<< HEAD
this.plateau.getCase(x, y).setType(Type.GRASS);
this.y-=1;
=======
updateDecouverte(this.plateau.getCase(x, y-1), this.vision);
>>>>>>> 663e9463f07e3e309d4b27451be1390f7ac87d7e
return true;
}
}
else if(c == 'z') {
if (updatePosition(x-1, y)) {
this.plateau.getCase(x, y).setUnite(null);
<<<<<<< HEAD
this.plateau.getCase(x, y).setType(Type.GRASS);
this.x-=1;
=======
updateDecouverte(this.plateau.getCase(x-1, y), this.vision);
>>>>>>> 663e9463f07e3e309d4b27451be1390f7ac87d7e
return true;
}
}
return false;
}
<<<<<<< HEAD
public void teleporte() {
Random alea = new Random();
int longueur = plateau.getPlateau().length*plateau.getRegion(0, 0).region.length;
......@@ -199,7 +188,6 @@ public abstract class Unite {
this.x=rd1;
this.y=rd2;
}
=======
public void updateDecouverte (Case emplacement, int vision) {
System.out.println("" + emplacement.getX() + ", " + emplacement.getY());
if (emplacement.getX()+1 < this.plateau.getLength()) {
......@@ -236,8 +224,6 @@ public abstract class Unite {
}
}
>>>>>>> 663e9463f07e3e309d4b27451be1390f7ac87d7e
public abstract String toString();
public abstract boolean action();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment