Skip to content
Snippets Groups Projects
Commit 9fff26e8 authored by Yanis O's avatar Yanis O
Browse files

[Ajout] Structure de données Square

parent 89671222
No related branches found
No related tags found
No related merge requests found
package model;
import java.util.ArrayList;
import java.util.List;
import util.Position;
public class Square {
private List<Entity> entities;
private Position position;
public Square(Position position){
this.entities = new ArrayList<Entity>();
this.entities.add(new EmptySquare(position));
this.position = position;
}
public Square(Position position, Entity entity){
this.entities = new ArrayList<Entity>();
this.entities.add(entity);
this.position = position;
}
public List<Entity> getEntities(){
return this.entities;
}
public Position getPosition(){
return this.position;
}
public void addEntity(Entity entity){
entities.add(entity);
}
public void removeEntity(Entity entity){
entities.remove(entity);
}
public void setEntities(List<Entity> entities){
this.entities = entities;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment