예제 #1
0
 public Performer(IAgent <TAction, TGoal> agent)
 {
     _planHandler = new PlanHandler <TAction>();
     _planHandler.AddCompleteCallBack(PlanComplete);
     _planner       = new Planner <TAction, TGoal>(agent);
     _goalManager   = agent.GoalManager;
     _actionManager = agent.ActionManager;
     _actionManager.AddActionCompleteListener(PlanActionComplete);
 }
예제 #2
0
파일: Performer.cs 프로젝트: JCYTop/Tmp
 public Performer(IAgent <TAction, TGoal> agent)
 {
     planHandler = new PlanHandler <TAction>();
     planHandler.AddCompleteCallBack(() =>
     {
         //计划完成
         DebugMsg.Log("计划完成");
         actionManager.IsPerformAction = false;
     });
     planner       = new Planner <TAction, TGoal>(agent);
     goalManager   = agent.GoalManager;
     actionManager = agent.ActionManager;
     actionManager.AddActionCompleteListener((actionLabel) =>
     {
         //计划完成了当前动作
         DebugMsg.Log("下一步");
         if (planHandler.GetCurrentHandler().Label.ToString() == actionLabel.ToString())
         {
             planHandler.HandlerAction();
         }
     });
 }