resolution probleme lié au conflit git

This commit is contained in:
2024-11-17 12:00:36 +01:00
parent 3faebe90df
commit 687d55ee31
17 changed files with 321 additions and 164 deletions

View File

@@ -0,0 +1,29 @@
package model;
import java.awt.*;
import java.util.HashMap;
import java.util.Map;
public class Board {
private final Map<Point, Tile> tiles;
public Board() {
this.tiles = new HashMap<>();
}
public boolean isPositionOccupied(Point position) {
return tiles.containsKey(position);
}
public void addTile(Point position, Tile tile) {
tiles.put(position, tile);
}
public Tile getTile(Point position) {
return tiles.get(position);
}
public Map<Point, Tile> getTiles() {
return tiles;
}
}

View File

@@ -0,0 +1,5 @@
package model;
public enum Terrain {
MER, CHAMP, FORET, PRE, MONTAGNE
}

View File

@@ -0,0 +1,33 @@
package model;
/**
* Classe représentant une tuile du jeu.
*/
public class Tile {
private final Terrain terrain;
/**
* Constructeur pour une tuile.
*
* @param terrain Le type de terrain de la tuile.
*/
public Tile(Terrain terrain) {
this.terrain = terrain;
}
/**
* Obtient le terrain de la tuile.
*
* @return Le terrain de la tuile.
*/
public Terrain getTerrain() {
return terrain;
}
@Override
public String toString() {
return "Tile{" +
"terrain=" + terrain +
'}';
}
}