A type is a linked list. Each type you create is a seperate linked list.
When you go ThisEnemy.Enemy = New Enemy, what you are doing is adding an Enemy to the list of enemies, and assigning a pointer to that particular enemy to the variable ThisEnemy.
If you want a list of cats and a list of dogs, then you can either go:
Type Cat
Blah
End Type
Type Dog
Blah
End Type
Or, you can go:
Type Animal
Field Species
blah
End Type
Then you can pass any animal to a function which deals with animals, and use a case statement to dtermine which specific type of animal you are dealing with.
In addition, you can create a variable FirstCast.Animal, and store the pointer to the first cat that is in the list of animals. You can also store LastCat.Animal. Then, you can easily loop through only the cats in your list, though you must use a repeat or a while loop to do so. I think... I'm pretty sure you can't go For ThisCat.Cat = FirstCat to LastCat. Though it would certainly be nice if you could, and I don't see any reason why you should not be able to, from a language design standpoint.
When you go ThisEnemy.Enemy = New Enemy, what you are doing is adding an Enemy to the list of enemies, and assigning a pointer to that particular enemy to the variable ThisEnemy.
If you want a list of cats and a list of dogs, then you can either go:
Type Cat
Blah
End Type
Type Dog
Blah
End Type
Or, you can go:
Type Animal
Field Species
blah
End Type
Then you can pass any animal to a function which deals with animals, and use a case statement to dtermine which specific type of animal you are dealing with.
In addition, you can create a variable FirstCast.Animal, and store the pointer to the first cat that is in the list of animals. You can also store LastCat.Animal. Then, you can easily loop through only the cats in your list, though you must use a repeat or a while loop to do so. I think... I'm pretty sure you can't go For ThisCat.Cat = FirstCat to LastCat. Though it would certainly be nice if you could, and I don't see any reason why you should not be able to, from a language design standpoint.