Jump to content

ArrayList/List to Array


Isolate

Recommended Posts

Well all walking snippets ive seen only handle Position[]

but all generating scripts all output in ArrayList/List.

 

Google told me too:

ArrayList<Position> positionsList;
Position[] asPath = new Position[positionList.size];
asPath = positionsList.toArray(asPath);

//or something like this

and when i tried that it never seemed to work when it got to the walking function...

Link to comment
Share on other sites

Well all walking snippets ive seen only handle Position[]

but all generating scripts all output in ArrayList/List.

 

Google told me too:

ArrayList<Position> positionsList;
Position[] asPath = new Position[positionList.size];
asPath = positionsList.toArray(asPath);

//or something like this

and when i tried that it never seemed to work when it got to the walking function...

 
 
 
Position[] asPath = positionsList.toArray(new Position[positionsList.size()]);
Edited by Th3
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...