From 72dec106dd2d5646cdfb6e8c89aded3368880e00 Mon Sep 17 00:00:00 2001 From: aminecmi Date: Wed, 7 Jan 2015 08:54:57 +0100 Subject: [PATCH] =?UTF-8?q?D=C3=A9but=20de=20cases.=20D=C3=A9but=20de=20co?= =?UTF-8?q?mportement=20d=C3=A9placement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Cases/CaseAbstraite.java | 21 +++++++++++++++++++++ src/Cases/Coordonnees.java | 27 +++++++++++++++++++++++++++ src/Cases/PointsCardinaux.java | 15 +++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 src/Cases/CaseAbstraite.java create mode 100644 src/Cases/Coordonnees.java create mode 100644 src/Cases/PointsCardinaux.java diff --git a/src/Cases/CaseAbstraite.java b/src/Cases/CaseAbstraite.java new file mode 100644 index 0000000..dd8cb03 --- /dev/null +++ b/src/Cases/CaseAbstraite.java @@ -0,0 +1,21 @@ +package Cases; + +import java.util.HashMap; + +public abstract class CaseAbstraite { + + HashMap voisins; + + Coordonnees coord; + + public CaseAbstraite(int vert, int hor) { + coord = new Coordonnees(vert, hor); + + // peupler ici ? + voisins = new HashMap(); + } + + public void ajouterVoisin(PointsCardinaux p, CaseAbstraite c) { + voisins.put(p, c); + } +} diff --git a/src/Cases/Coordonnees.java b/src/Cases/Coordonnees.java new file mode 100644 index 0000000..9c4a985 --- /dev/null +++ b/src/Cases/Coordonnees.java @@ -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; + } +} diff --git a/src/Cases/PointsCardinaux.java b/src/Cases/PointsCardinaux.java new file mode 100644 index 0000000..08e39c8 --- /dev/null +++ b/src/Cases/PointsCardinaux.java @@ -0,0 +1,15 @@ +package Cases; + +/** + * Created by : Amine + */ +public enum PointsCardinaux { + N, + NE, + E, + SE, + S, + SW, + W, + NW +}