struct myclass
{
void deleteGlobal()
{
@g = null;
Analyze(any(@this));
}
void mthd(int a)
{
int b = 3;
print("class:"+a+":"+b);
myclass tmp;
this = tmp;
this.c = 4;
}
void mthd2(int a)
{
print("class:"+a);
}
int c;
};
void mthd2(int a) { print("global:"+a); }
myclass @g;
void Test()
{
myclass a;
a.mthd(1);
Assert( a.c == 4 );
mthd2(2);
@g = myclass();
g.deleteGlobal();
}
AngelScript 2.5.1 WIP 1
I've uploaded version 2.5.1 WIP 1. I've added support for script declared class methods so you're now able to write scripts like this: This is of course just the beginning. I'll continue with adding constructors, and inheritance as well.
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement