package detectiongame.dungen;
import engine.Entity;
import java.util.Vector;
/**
*
* @author
* knasaari
*/
public class Grid {
Vector<Entity> entities;
int type;
float x,z;
public Grid(float x, float z){
entities = new Vector<>();
type = 1;
this.x = x;
this.z = z;
}
public Entity back(){
if(this.entities.isEmpty()) {
return null;
}
return this.entities.lastElement();
}
public Entity addEntity(Entity ent){
ent.setPos(this.x, 0f, this.z);
this.entities.add(ent);
return ent;
}
public void addEntity(){
this.entities.add(new Entity());
this.back().setPos(this.x, 0f, this.z);
}
public void clearEntities(){
this.entities.clear();
}
}