Jump to content
  • Advertisement
Sign in to follow this  
Miss

Property accessor mode was changed

Recommended Posts

Posted (edited)

Noticed there were some new commits about a "property" keyword that was added and the default property accessor mode was changed: https://github.com/codecat/angelscript-mirror/commit/9e7e64b997653301971aadd2de1c5947f7ee3bea

I wonder what the decision is behind that, as I was quite surprised to see a ton of script errors after updating from source today, without any indication that I am missing property keywords on them. I think this is quite a big breaking change for a lot of people.

I'm not against change of course, I'm happy to adjust my code if necessary!

For anyone curious as well, setting the engine property for this back to 2 allows you to revert this behavior:

m_engine->SetEngineProperty(asEP_PROPERTY_ACCESSOR_MODE, 2);

 

Edited by Miss

Share this post


Link to post
Share on other sites
Advertisement

The decision for this change was due to the need to improve how the virtual property accessors are evaluated (previously only done when the virtual property accessor was used, and not when declared/registered), and also to give the script writer the option to chose whether or not a method with set_/get_ prefix actually should be treated as a virtual property accessor by the compiler.

As you rightly figured out, if desired the backwards compatibility is maintained by setting the asEP_PROPERTY_ACCESSOR_MODE to 2.

 

I've yet to update the documentation with these changes. I plan to do so over the next few days.

 

Let me know if you think it could have been done better in a different way. I'll be happy to review any suggestions and change if they are better.

Share this post


Link to post
Share on other sites

I maintain my hobby game engine. I have a set of properties per module. The universal method to change module specific options is in my opinion a good way to go. It simplifies the life of the programmer that is not concerned with where the option comes from he knows it exists and just wants to configure it.
I'm considering it to be an improvement to implement in the engine.

Share this post


Link to post
Share on other sites

Yes, it is probably a good change. I was just surprised to see it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
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!