Compare commits
2 Commits
56727aea9f
...
classe_tui
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a51eab8df2 | ||
|
|
1d2f169417 |
25
HexPly.java
Normal file
25
HexPly.java
Normal 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";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import java.util.List;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
public class Tuile {
|
public class Tuile {
|
||||||
/*ATTRIBUTS*/
|
/*ATTRIBUTS*/
|
||||||
private byte y;
|
private byte y;
|
||||||
private byte r;
|
private byte r;
|
||||||
private String color;
|
private String color;
|
||||||
private List<Tuile> voisins = new List<Tuile>();
|
private LinkedList<Tuile> voisins = new LinkedList<Tuile>();
|
||||||
|
|
||||||
/*METHODES*/
|
/*METHODES*/
|
||||||
public byte getY(){
|
public byte getY(){
|
||||||
@@ -24,7 +24,7 @@ public class Tuile {
|
|||||||
this.voisins.add(v);
|
this.voisins.add(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Tuile> getVoisins(){
|
public LinkedList<Tuile> getVoisins(){
|
||||||
return this.voisins;
|
return this.voisins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user