🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

properties

Started by
0 comments, last by WitchLord 17 years, 3 months ago
I think it should be great if we can register get & set methods for property access as in js 1.5: engine->RegisterObjectProperty( "object", "int prop", asFUNCTION(object_get), asFUNCTION(object_set), asCALL_GENERIC );
Advertisement
I know. :)

Excerpt from my to-do list:

--

Getters and Setters for properties


Requires: Removing parameter references

This will allow the application to register a couple of functions to manipulate properties. An example that shows the usefulness of this is: Say you've registered HWND as a type, and you want to let the script change the title of the window. You can either register the Set/GetWindowText() as methods which will be explicitly called, or you can register a get/set property called text, which the script can access just like any other object property.

I need to investigate the complications of this. What happens for example if a property is passed by reference to a function that is supposed to update it? Since the get/set property isn't a real reference this has to be checked for.

Priority: low
--

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement