Type Query

Blitz3D Forums/Blitz3D Beginners Area/Type Query

Gord(Posted 2004) [#1]
Can there be more than one instance of a Type?
If I had a Spaceship type could sp1 and sp2 share the same type or must each ship have its own type?


Jeppe Nielsen(Posted 2004) [#2]
There can be as many instances of a type as you like, and there can be as many variables/pointers to one instance of a type as you like. So yes both sp1 and sp2 variables/pointers could point to the same type.


Zethrax(Posted 2004) [#3]
Using the 'New' constructor command you can create as many instances of a Type as you want, with each new instance being tacked onto the end of the instance chain for that Type. Each instance can hold unique data, although the structure will be the same as all the other instances of that type.