urho3d/Urho3D — pull request #502 by alexparlett (2014-10-26 12:03:52+00:00)
Title: [Added] Ability to create script object by specifying an interface it im...

Adds the ability to specify that the class name handed to create the script object is an interface and it should pick the first class found that implements that interface as long as the interface has been registered with the script engine. Keeps the requirement to inherit from ScriptObject as well.

Found this useful for exposing modding capabilities while requiring certain interfaces from the C++ side, might not fit in the engine as a whole.

Quick example

~~~
engine->RegisterInterface("Map");
engine->RegisterInterfaceMethod("Map", "void generate()");
~~~

~~~
class CampaignMap : Map, ScriptObject
{
CampaignMap()
{
}

void generate()
{
}
}
~~~