Type Query
Blitz3D Forums/Blitz3D Beginners Area/Type Query
| ||
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? |
| ||
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. |
| ||
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. |