Game Development Community

addNamedField() vs addField()

by Edward F. Maurina III · in Torque Game Engine · 05/22/2003 (11:07 pm) · 2 replies

In Torque, there is a function addField() and a MACRO addNamedField().

The MACRO calls addField() and exposes a class member as a console field, using the SAME name as the class member.

For all intensive purposes, this is just a less flexible version of addField.

My question is, "Is there more to this or a good reason why this was done?" I feel like there must be more to the story, but I'm not quite reading it?

Any experts care to comment?

I would also like to hear some comments on the use/purpose of addDepricatedField().

Thanks,

ED

#1
05/23/2003 (10:20 am)
addNamedField() is probably a convenience function (same for addDeprecatedField); if you have to type a name twice it raises more possibility for error, so since very often your member name and script name will be the same, they defined the macro function.

I don't have the source in front of me; addDeprecated is probably more to mark that the member will be gone someday than for any change in functionality.
#2
05/26/2003 (1:44 pm)
Thanks Ben. I'll go with this data.

-Ed