Merge branch 'main' of https://gitarero.ecam.fr/guillaume.bonabau/OOP_F1_Project
This commit is contained in:
commit
ea3134bc5c
|
|
@ -3,21 +3,42 @@ package backend;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class Table {
|
public class Table {
|
||||||
int vertexCount = 3;
|
private int height;
|
||||||
ArrayList<ArrayList<Cell>> table = new ArrayList<>(vertexCount);
|
private int width;
|
||||||
|
private ArrayList<ArrayList<Cell>> table;
|
||||||
|
|
||||||
//TODO : create constructor
|
//TODO-INPROGRESS : create constructor
|
||||||
|
public Table(int height, int width) {
|
||||||
|
this.height = height;
|
||||||
|
this.width = width;
|
||||||
|
|
||||||
public int getCell(int x,int y) {
|
//initialize the table
|
||||||
return table.get(x).add(y);
|
int vertexCount = 3;
|
||||||
|
table = new ArrayList<>(vertexCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO : get(xy)
|
public int getheight() {
|
||||||
//TODO : set(xy)
|
return this.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getwidth() {
|
||||||
|
return this.width;
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO-COMPLETE : create getCell
|
||||||
|
public Cell getCell(int x,int y) {
|
||||||
|
//return the Cell object of coordinates x, y
|
||||||
|
return table.get(x).get(y);
|
||||||
|
}
|
||||||
|
//TODO : set(Cell, x, y) set an object Cell to coordinate x, y
|
||||||
|
|
||||||
//TODO : count around (xy) -> return how many around this cell
|
//TODO : count around (xy) -> return how many around this cell
|
||||||
//TODO : step : apply game rules for 1 tick ()
|
|
||||||
//TODO : set agent (xy)
|
//TODO : set agent (x y agent) load an agent to coordinates x,y
|
||||||
//TODO : set random (density)
|
|
||||||
//TODO : load(filepath)
|
//TODO : set random (density) create a random table of determined density
|
||||||
//TODO : save(filename)
|
|
||||||
|
|
||||||
|
//TODO : load(filepath) turn a loaded saveable file into a table
|
||||||
|
//TODO : save(filename) turn the table into saveable file
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue