getAgentsSave
This commit is contained in:
parent
4d7f223e9d
commit
1c69102be1
|
|
@ -413,8 +413,18 @@ public class Simulator extends Thread {
|
|||
|
||||
|
||||
public ArrayList<String> getAgentsSave() {
|
||||
//TODO : Same idea as the other save method, but for agents
|
||||
return null;
|
||||
ArrayList<String> agentsSave = new ArrayList<>();
|
||||
for (int j = 0; j < getHeight(); j++) {
|
||||
StringBuilder lineState = new StringBuilder();
|
||||
for (int i = 0 ; i < getWidth() ; i++) {
|
||||
lineState.append(getCell(i, j));
|
||||
if (j < getHeight() -1) {
|
||||
lineState.append(",");
|
||||
}
|
||||
}
|
||||
agentsSave.add(lineState.toString());
|
||||
}
|
||||
return agentsSave;
|
||||
}
|
||||
|
||||
public void loadAgents(ArrayList<String> stringArray) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue