libgdx / gdx-ai

Artificial Intelligence framework for games based on libGDX or not. Features: Steering Behaviors, Formation Motion, Pathfinding, Behavior Trees and Finite State Machines
Apache License 2.0
1.18k stars 241 forks source link

Is there something wrong here in Parallel? #113

Closed hl845740757 closed 10 months ago

hl845740757 commented 3 years ago

Issue details

It seems that reset should be replaced by resettask


    public void resetAllChildren() {
        for (int i = 0, n = getChildCount(); i < n; i++) {
            Task<E> child = getChild(i);
            child.reset();
        }
    }

       //  Orchestrator.Join
        if (parallel.lastResult != null) { // Current child has finished either with success or fail
            parallel.cancelRunningChildren(parallel.noRunningTasks ? parallel.currentChildIndex + 1 : 0);
            parallel.resetAllChildren();
            if (parallel.lastResult)
                parallel.success();
            else
                parallel.fail();
            return;
        }

Version of gdx-ai and/or relevant dependencies

1.8.2