List Problem

BlitzMax Forums/BlitzMax Beginners Area/List Problem

po(Posted 2007) [#1]
I'm making a basic RTS and I've just finished the pathfinding. I need each TUnit object to have seperate lists which can hold the results from the pathfinding, so that each unit can move around at the same time. Here's some code:



See the TUnit type for an idea of what I want to do. But this gives me an error as lists can't be local? What should I do? The PathList list is the end result of the pathfinding and is basically what I want each TUnit object to have.

-Thanks


TaskMaster(Posted 2007) [#2]
Why do you think a TList can't be a Field? In a type, you set local variable to Field, not Local...

Type TMyType
Field MyList:Tlist
End Type


po(Posted 2007) [#3]
Wow. Dear god I really wish I'd known that before. Thanks!