Are Entities and Handle()s unique?

Blitz3D Forums/Blitz3D Programming/Are Entities and Handle()s unique?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I use IDs because I find it to be a easier way to link diffent types to different types compared to using types within types.


Funny, I thought the easiest way to link objects (types) to different objects was to have your objects have references to each other (types within types). foo\bar seems much simpler to me than bar[foo\bar_id].

Yes, if you need keys (IDs) (and since you're talking about dealing with externally-derived data, you probably do,) you have the choice of either a vector (array) or a hash. They each have their advantages and disadvantages.

Object/Handle are assigned by Blitz the ID at run-time in a sequential order. This can really complicated ID assignment at design time.


Whoa. That's a whole different bag of worms. Handle() essentially returns pointers, which are useful for when you want to store a reference to an object somewhere that's not type-qualified. Although it's feasible that you might use Handle() to generate unique IDs for serializing a bunch of objects without their own IDs, you certainly wouldn't want to use those IDs as vector keys!