Package detectiongame.dungen

Source Code of detectiongame.dungen.Grid

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();
  }
}
TOP

Related Classes of detectiongame.dungen.Grid

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.