Jump to content

Reserving a path


TheScrub

Recommended Posts

a lot of people releasing these walking snippets so i figured seeming the api doesn't have a method to reverse a path i would release 1

 

here u go simple but helpful!

    private Position[] reversePath(Position[] path) {
        ArrayList<Position> pos = new ArrayList<Position>();
        Position[] target = null;
        
        for (int i= 0;i<path.length;i++){
            pos.add(path[path.length-i-1]);
        }
        target = pos.toArray(new Position[pos.size()]);
        return target;
        
    }
Edited by TheScrub
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...