using System;
using System.Collections.Generic;
using Rayman;

public class GoalSeekEvaluator : GoalBaseEvaluator{
	private CActorEntity _target = null;

	public GoalSeekEvaluator (float fix) : base(fix){}

	public override float CalculateDesirability(CActorEntity owner){
		ActorAIComp ai = owner.GetComponent<ActorAIComp>();
		if (ai.target == null)return 0;

		_target = ai.target;
		return 1;
	}
	
	public override void SetGoal(CActorEntity owner){
		if(_target == null)return;
		_brain.AddGoal_Seek(_target);
	}
}