package ei.game.player;

import java.util.ArrayList;

import ei.engine.scene.Node;
import ei.game.scene.GameEntity;
import ei.game.scene.units.Unit;

public class HumanPlayer extends Player{
	private ArrayList<GameEntity> units;
	private Node unitsNode;
	
	public HumanPlayer(){
		units = new ArrayList<GameEntity>();
		unitsNode = new Node("UnitsNode");
	}
	
	public void addUnit(Unit u){
		units.add(u);
		unitsNode.add(u.getNode());
	}
	
	public void removeUnit(Unit u){
		units.remove(u);
		unitsNode.remove(u.getNode());
	}
	
	public Node getNode(){
		return unitsNode;
	}

	public void update() {
		for(int i=0; i<units.size() ;i++){
			units.get(i).update();			
		}
	}
}
