interface MyIntf
{
void DoSomething();
}
class MyClass : MyIntf
{
void DoSomething() { print("Doing something\n"); }
}
void Test()
{
MyClass a;
MyIntf @b = a;
b.DoSomething();
}
I'm sure you can see the potential of this.
Some of the things I still need to implement:
- Saving/loading bytecode with declared interfaces.
- Faster resolution of calls to interface methods.
- Registration of interfaces from the application so that the script classes can be passed directly to application registered functions.
- Explicit casting from interface to class. Gives a null handle if the cast is illegal.
🎉 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!
Interfaces in the script language are available in SVN
I've just committed the addition of interfaces in the script language to the SVN.
There is still a lot to do before I release the next version 2.7.0, but the interfaces are working (even though they are currently very slow).
You can now write code like:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement