diff --git a/src/main/java/model/Square.java b/src/main/java/model/Square.java new file mode 100644 index 0000000000000000000000000000000000000000..23acc13a405eaa2c9f290c1d0a79c37a7651909c --- /dev/null +++ b/src/main/java/model/Square.java @@ -0,0 +1,42 @@ +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; + } + +}