package rpgEngine.Data.Abstract.NPC;

public class ScriptPlayer {
	private Script script;
	private Integer index;
	
	
	public ScriptPlayer(Script s) {
		script = s;
		index = -1;
	}
	
	
	public Boolean hasNext() {
		Boolean result = false;
		
		if((index+1) < script.getScriptItems().size()) {
			result = true;
		}
		
		return result;
	}
	
	
	public ScriptItem next() {
		ScriptItem item = null;
		
		index++;
		
		try {
			item = script.getScriptItems().get(index);
		}
		catch(Exception e) {
			item = null;
		}
		
		return item;
	}
	
	
	public ScriptItem current() {
		ScriptItem item = null;
		
		try {
			item = script.getScriptItems().get(index);
		}
		catch(Exception e) {
			item = null;
		}
		
		return item;
	}
	
	
	public void setIndex(Integer i) {
		index = i;
	}
	
	
	public Integer getIndex() {
		return index;
	}
	
	
}
