You Have Been ID’d

I know why, long long ago, people created 4GL languages. Well, maybe not every reason. But this one MUST have been at the forefront.

To take care of File Structures. At least, that’s what I imagine the guys did with Clarion.

Tonight I implemented Unique ID fields across all my classes. It was an enlightening experience. I enjoyed it somewhat, but then … I only have a handful of classes, and this is my first time. I can imagine if you had a couple of hundred classes, many of the child classes, but needing their own Unique ID’s as well, it would quickly become a rather onorous task to write the functions to take care of the UID’s.

To achieve my goals, I wrote it out straight. That is, looped through the objects, assigned the local var xID, and then incremented said xID var. Easy. Simple. As said, there’s only a handful of classes .. well, really, it’s only a handful of objects to go through. There aren’t many objects within the game world.

That reminds me.

Last night I realised one important facet I’d forgotten about the basic design. The World class. A class that tracks every object that is within it. At the moment, my Game Object is that, but this, for any real project, is very impracticle.

But for the sake of my initial goals, I’m pressing on.