Compare commits

2 Commits

Author SHA1 Message Date
vaisse
a51eab8df2 classe tuile + classe hexply. Pour Riad 2025-10-16 11:37:40 +02:00
vaisse
1d2f169417 classe tuile 2025-10-16 11:35:37 +02:00
2 changed files with 28 additions and 3 deletions

25
HexPly.java Normal file
View File

@@ -0,0 +1,25 @@
public class HexPly extends AbstractPly{
//attributs
private byte y;
private byte r;
private String color;
//méthodes
public Tuile attemptPlaceTuile(){
Tuile t = new Tuile(this.y, this.r, this.color);
return t;
}
//constructeur
public HexPly(byte y, byte r, Player p){
this.y = y;
this.r = r;
this.joueur = p;
if(p == Player.PLAYER1){
this.color = "blue";
} else {
this.color = "red";
}
}
}

View File

@@ -1,11 +1,11 @@
import java.util.List;
import java.util.LinkedList;
public class Tuile {
/*ATTRIBUTS*/
private byte y;
private byte r;
private String color;
private List<Tuile> voisins = new List<Tuile>();
private LinkedList<Tuile> voisins = new LinkedList<Tuile>();
/*METHODES*/
public byte getY(){
@@ -24,7 +24,7 @@ public class Tuile {
this.voisins.add(v);
}
public List<Tuile> getVoisins(){
public LinkedList<Tuile> getVoisins(){
return this.voisins;
}