

function IdleAction(character){
	this.name = "idle";
	this.character = character;
	this.animation = character.animations["idle"];
	this.relations = new Array();
	this.age = 0;
}

IdleAction.prototype.update = function(time){
	this.animation.addTime(time);
	for(var i = 0; i < this.relations.length; i++){
		var rel = this.relations[i];
		var res = rel.condition();
		if(res){
			return rel.targetAction;
		}
	}
	
	return this;
}

IdleAction.prototype.setTime = function(time){
	this.age = time;
	this.animation.setTime(time);
}

