mirror of
https://github.com/guezoloic/racing-game.git
synced 2026-03-28 18:03:50 +00:00
feat: ajout getters
This commit is contained in:
16
src/Map.java
16
src/Map.java
@@ -22,6 +22,8 @@ public class Map
|
||||
*/
|
||||
private ArrayList<Point> pathMap;
|
||||
|
||||
private int width, height;
|
||||
|
||||
/**
|
||||
* Crée une nouvelle instance de Map à partir d'un tableau générique
|
||||
* et d'une fonction de transformation.
|
||||
@@ -108,6 +110,10 @@ public class Map
|
||||
private Map(Circuit[][] map)
|
||||
{
|
||||
this.map = map;
|
||||
|
||||
this.width = map[0].length;
|
||||
this.height = map.length;
|
||||
|
||||
boolean isPossible = this.buildPath();
|
||||
|
||||
if (!isPossible)
|
||||
@@ -280,4 +286,14 @@ public class Map
|
||||
{
|
||||
return this.pathMap.size();
|
||||
}
|
||||
|
||||
public int getWidth()
|
||||
{
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
return this.height;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user