From 56727aea9f7fa2836443aea3262347806dd14467 Mon Sep 17 00:00:00 2001 From: vaisse Date: Thu, 16 Oct 2025 11:30:05 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Une=20classe=20tuile,=20s=C3=BBrement=20uti?= =?UTF-8?q?le?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tuile.java | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Tuile.java diff --git a/Tuile.java b/Tuile.java new file mode 100644 index 0000000..9ef3eb8 --- /dev/null +++ b/Tuile.java @@ -0,0 +1,37 @@ +import java.util.List; + +public class Tuile { + /*ATTRIBUTS*/ + private byte y; + private byte r; + private String color; + private List voisins = new List(); + + /*METHODES*/ + public byte getY(){ + return this.y; + } + + public byte getR(){ + return this.r; + } + + public String getColor(){ + return this.color; + } + + public void addVoisin(Tuile v){ + this.voisins.add(v); + } + + public List getVoisins(){ + return this.voisins; + } + + /*CONSTRUCTEUR*/ + public Tuile(byte y, byte r, String c){ + this.y = y; + this.r = r; + this.color = c; + } +} \ No newline at end of file -- 2.51.0 From 1d2f169417674ea8ff636029fbd398162889d0dc Mon Sep 17 00:00:00 2001 From: vaisse Date: Thu, 16 Oct 2025 11:35:37 +0200 Subject: [PATCH 2/3] classe tuile --- Tuile.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tuile.java b/Tuile.java index 9ef3eb8..385f81d 100644 --- a/Tuile.java +++ b/Tuile.java @@ -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 voisins = new List(); + private LinkedList voisins = new LinkedList(); /*METHODES*/ public byte getY(){ @@ -24,7 +24,7 @@ public class Tuile { this.voisins.add(v); } - public List getVoisins(){ + public LinkedList getVoisins(){ return this.voisins; } -- 2.51.0 From a51eab8df24c2a210c2d0656c788199f9345d3ad Mon Sep 17 00:00:00 2001 From: vaisse Date: Thu, 16 Oct 2025 11:37:40 +0200 Subject: [PATCH 3/3] classe tuile + classe hexply. Pour Riad --- HexPly.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 HexPly.java diff --git a/HexPly.java b/HexPly.java new file mode 100644 index 0000000..a196378 --- /dev/null +++ b/HexPly.java @@ -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"; + } + } +} \ No newline at end of file -- 2.51.0