Début de cases. Début de comportement déplacement.
This commit is contained in:
parent
86149dec7c
commit
72dec106dd
21
src/Cases/CaseAbstraite.java
Normal file
21
src/Cases/CaseAbstraite.java
Normal file
@ -0,0 +1,21 @@
|
||||
package Cases;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public abstract class CaseAbstraite {
|
||||
|
||||
HashMap<PointsCardinaux, CaseAbstraite> voisins;
|
||||
|
||||
Coordonnees coord;
|
||||
|
||||
public CaseAbstraite(int vert, int hor) {
|
||||
coord = new Coordonnees(vert, hor);
|
||||
|
||||
// peupler ici ?
|
||||
voisins = new HashMap<PointsCardinaux, CaseAbstraite>();
|
||||
}
|
||||
|
||||
public void ajouterVoisin(PointsCardinaux p, CaseAbstraite c) {
|
||||
voisins.put(p, c);
|
||||
}
|
||||
}
|
27
src/Cases/Coordonnees.java
Normal file
27
src/Cases/Coordonnees.java
Normal file
@ -0,0 +1,27 @@
|
||||
package Cases;
|
||||
|
||||
public class Coordonnees {
|
||||
private int vert;
|
||||
private int hor;
|
||||
|
||||
public Coordonnees(int vert, int hor) {
|
||||
this.vert = vert;
|
||||
this.hor = hor;
|
||||
}
|
||||
|
||||
public int getVert() {
|
||||
return vert;
|
||||
}
|
||||
|
||||
public void setVert(int vert) {
|
||||
this.vert = vert;
|
||||
}
|
||||
|
||||
public int getHor() {
|
||||
return hor;
|
||||
}
|
||||
|
||||
public void setHor(int hor) {
|
||||
this.hor = hor;
|
||||
}
|
||||
}
|
15
src/Cases/PointsCardinaux.java
Normal file
15
src/Cases/PointsCardinaux.java
Normal file
@ -0,0 +1,15 @@
|
||||
package Cases;
|
||||
|
||||
/**
|
||||
* Created by : Amine
|
||||
*/
|
||||
public enum PointsCardinaux {
|
||||
N,
|
||||
NE,
|
||||
E,
|
||||
SE,
|
||||
S,
|
||||
SW,
|
||||
W,
|
||||
NW
|
||||
}
|
Loading…
Reference in New Issue
Block a user