/Code/src/com/game/AI/LeafTask.java
https://bitbucket.org/DeveloperUX/behaviortree · Java · 58 lines · 24 code · 5 blank · 29 comment · 0 complexity · 3b8b7888ff99d5b4c68614d800335871 MD5 · raw file
- package com.game.AI;
-
- /**
- * Leaf task (or node) in the behavior tree.
- *
- * Specifies a TaskControler, by composition,
- * to take care of all the control logic,
- * without burdening the Task class with
- * complications.
- *
- * @author Ying
- *
- */
- public abstract class LeafTask extends Task
- {
- /**
- * Task controler to keep track of the Task state.
- */
- protected TaskController control;
-
- /**
- * Creates a new instance of the LeafTask class
- * @param blackboard Reference to the AI Blackboard data
- */
- public LeafTask(Blackboard blackboard)
- {
- super(blackboard);
- CreateController();
- }
-
- /**
- * Creates a new instance of the LeafTask class
- * @param blackboard Reference to the AI Blackboard data
- * @param name Name of the class for debugging
- */
- public LeafTask(Blackboard blackboard, String name)
- {
- super(blackboard, name);
- CreateController();
- }
-
- /**
- * Creates the controller for the class
- */
- private void CreateController()
- {
- this.control = new TaskController(this);
- }
-
- /**
- * Gets the controller reference.
- */
- @Override
- public TaskController GetControl()
- {
- return this.control;
- }
- }