Example usage for com.badlogic.gdx.ai.pfa GraphPath add

List of usage examples for com.badlogic.gdx.ai.pfa GraphPath add

Introduction

In this page you can find the example usage for com.badlogic.gdx.ai.pfa GraphPath add.

Prototype

public void add(N node);

Source Link

Document

Adds an item at the end of this path.

Usage

From source file:us.thirdmillenium.strategicassaultsimulator.ai.tile.TileAStarPathFinder.java

License:Apache License

private boolean returnNodePath(AStarTileNode lastNode, GraphPath<TileNode> outPath) {
    AStarTileNode walkBack = lastNode;//from   w w  w .  j a  v a  2 s .  c  o  m

    while (walkBack != null && !walkBack.isFirstNode()) {
        outPath.add(walkBack.getTileNode());
        walkBack = walkBack.getCameFrom();
    }

    //outPath.reverse();

    return true;
}