Début de cases. Début de comportement déplacement.

This commit is contained in:
aminecmi 2015-01-07 08:54:57 +01:00
parent 86149dec7c
commit 72dec106dd
3 changed files with 63 additions and 0 deletions

View 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);
}
}

View 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;
}
}

View File

@ -0,0 +1,15 @@
package Cases;
/**
* Created by : Amine
*/
public enum PointsCardinaux {
N,
NE,
E,
SE,
S,
SW,
W,
NW
}