using UnityEngine; using System.Collections; namespace JungleDB { public class DefaultEvaluator : Evaluator { private NodePath path; public DefaultEvaluator(NodePath _path) { path = _path; } public Evaluation evaluate(TreeNode _current, int _pos){ Pair pop = path.pop (); int head = pop.lefts (); if (path.size () == 1) { if (head == _pos) { return new DefaultEvaluation (Result.GOAL, null); } } DefaultEvaluator nextEvaluator; Result result; if (head == _pos) { result = Result.ACCEPT; nextEvaluator = new DefaultEvaluator (pop.rights ()); } else { result = Result.CONTINUE; nextEvaluator = null; } return new DefaultEvaluation (result, nextEvaluator); } } }