Jump to content
  • Advertisement
Sign in to follow this  
WitchLord

AngelScript getters and setters (WIP)

This topic is 3383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm making good progress on the support for getters and setters in AngelScript. I still have some tests to write but I think they are already working pretty well. For that reason I'd like for whoever intend to use these to give the new feature a try, to see if we can root out any potential bugs before I release version 2.17.1. You add getters and setters in objects (both script classes and registered types) by declaring a couple of methods like this:
class MyObject
{
   int get_Prop() { /* return the value */ }
   void set_Prop(int v) { /* set the value */ }
}
When accessing the member Prop of this class, the correct property accessor method will be called based on what the expression is used for. Observation: Both the get and set methods must have matching types, otherwise the compiler won't know what type to use. Please download the latest revision from the SVN, and let me know if you encounter any problems with the getters and setters.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!