Problem with OOP

BlitzMax Forums/BlitzMax Programming/Problem with OOP

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

In other versions of Blitz, I experienced some limtations with types and started using banks for all my structures.

For example, if I have a field in a type that needs to be able to reference multiple types of objects, it isn't possible:

Type thing
Field target.otherthing


If "target" is a .terrain, I can't reference it, unless I use Handle() to store the object integer handle. Then when I am using the target value, I have to do this mess:

If Object.terrain(thing\target)<>Null
If Object.mesh(thing\target)<>Null
If Object.texture(thing\target)<>Null


If I use banks, I can just do this:
target=PeekInt(thing,THING_TARGET)
class=PeekInt(target,OBJECT_CLASS)


Also, types don't work well if you are controlling the application with a script, or (theoretically) compiling it to a dll.

Has anything changed in BlitzMax that makes this different? Am I overlooking anything important?