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
Type TPath Global PathList:TList=New TList 'bunch of code in here that produces a bunch of tileID's and puts them in PathList End Type Type TStructure Global StructureList:TList=New TList Method New() StructureList.AddLast(Self) End Method End Type Type TUnit Extends TStructure Field x:Int,y:Int,sp:Int 'etc... Local RouteList:TList=New TList 'would this be possible? End Type
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