game-ai/src/main/java/com/jzy/game/ai/btree/BehaviorTree.java
/**
	 * This method will add a child, namely the root, to this behavior tree.
	 * 
	 * @param child
	 *            the root task to add
	 * @return the index where the root task has been added (always 0).
	 * @throws IllegalStateException
	 *             if the root task is already set.
	 */
This method will add a child, namely the root, to this behavior tree.

@param child
the root task to add
@return the index where the root task has been added (always 0).
@throws IllegalStateException
if the root task is already set.
This method will add a child namely the root to this behavior tree . @param child the root task to add @return the index where the root task has been added ( always 0 ) . @throws IllegalStateException if the root task is already set .
@Override
	protected int addChildToTask(Task<E> child) {
		if (this.rootTask != null)
			throw new IllegalStateException("A behavior tree cannot have more than one root task");
		this.rootTask = child;
		return 0;
	}
@ Override protected int addChildToTask ( Task < E > child ) { if ( this . rootTask != null ) throw new IllegalStateException ( "A behavior tree cannot have more than one root task" ) ; this . rootTask = child ; return 0 ; }
This method will add a child, namely the root, to this behavior tree.
This method will add a child namely the root to this behavior tree .