Jump to content
  • Advertisement
Sign in to follow this  
seeseekey

Static method members in AngelScript

This topic is 2609 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

Hi,

currently i try to write the following Angelscript script:

class Mana
{
Mana()
{
}

// Destructor
~Mana()
{
}

static int GetTestValue() //I know that this not work.
{
return 555;
}
}


I will call the function like:

int test=Mana.GetTestValue();

Is there a possibility to implement static methods in a class or put them in a namespace in AngelScript?

Sincerly,

seeseekey

Share this post


Link to post
Share on other sites
Advertisement
Not yet.

I've not implemented namespaces in AngelScript yet. A static method is just a global function in the namespace of the class, so can only be supported once I have namespaces.

Regards,
Andreas

Share this post


Link to post
Share on other sites
Namespaces will be a very welcome addition once they're added. What is the likelihood that improved module importing will come with it?

Share this post


Link to post
Share on other sites
Improvements will always come. You may be interested in the new 'shared code' feature that I'm implementing for 2.22.0. It will allow multiple modules to share the same classes (not just interfaces as before). I will eventually expand this to allow sharing of global variables and functions too, though not for 2.22.0.

What exactly did you have in mind with improved module importing?

Share this post


Link to post
Share on other sites
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!