I have a type construct that has a fair few hundred elements at present. Each one has a field which contains its unique ID, which I need so that other sections of the game can work out what object it is and so forth.
Is there any way I can access this one directly without having to do a For Each loop? Or is there another way of coding it - perhaps something I've missed - that allows me to directly access one specific object?
Now, I could use an array of objects, each element of the array pointing to one object, and I could reference that. However, doing that means that either the array will be absolutely huge with many empty elements, or I have to abandon the current system I use for unique IDs (where the first two digits correspond to what it belongs to) which makes a lot of the design and coding a much bigger headache than it really needs to be.
Any ideas, or am I doomed to either get a big headache or use a For Each loop?
|