Skip to main content
GameDev.net gamedev.net
🔒 Locked

enum?

Started by Dovyman Jan 28, 2003 at 6:31 PM 1 replies 200+ views
Original Post
Dovyman
Dovyman
Ok I have this class, cModelFactory, which is basically responsible for getting a list of filenames from a script and loading models from those filenames. The user must specify a "name" for each model in the script. So cModelFactory does its thing and I have a vector of models, thats all well and good. But how can I somehow enum them with the names the user provided? [edited by - Dovyman on January 28, 2003 7:33:15 PM]
felisandria
felisandria
Well, first off, what would be the point? Unless of course you''re dynamically changing the code to match some odd code-builder app that you''re giving the user, in which case it''s just a matter of parsing. Otherwise, you''re never going to know what those enums are to put them in the code anyway.

If it''s a matter of wanting ID numbers for your model structs for things like testing ==, etc, then just make the ID number a requirement and add an ID member to your struct (along with the name, so you can always get the name from the ID number). Or count them as you load them in, if you don''t want to make an ID number a requirement.

-fel

Darn 500 errors.
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.