Compare commits
4 Commits
instructio
...
a51eab8df2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a51eab8df2 | ||
|
|
1d2f169417 | ||
|
|
56727aea9f | ||
| 1c127319f9 |
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
37
Tuile.java
Normal file
37
Tuile.java
Normal file
@@ -0,0 +1,37 @@
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class Tuile {
|
||||
/*ATTRIBUTS*/
|
||||
private byte y;
|
||||
private byte r;
|
||||
private String color;
|
||||
private LinkedList<Tuile> voisins = new LinkedList<Tuile>();
|
||||
|
||||
/*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 LinkedList<Tuile> getVoisins(){
|
||||
return this.voisins;
|
||||
}
|
||||
|
||||
/*CONSTRUCTEUR*/
|
||||
public Tuile(byte y, byte r, String c){
|
||||
this.y = y;
|
||||
this.r = r;
|
||||
this.color = c;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user