It seems like methods GetInterfaceCount() and GetInterface() are ignoring namespaced interfaces. For example:
psg->SetDefaultNamespace("Base::Control");
psg->RegisterInterface("IComponent");
psg->SetDefaultNamespace("");
//Code pretty much the same code as in the angelscript's game sample
asIObjectType *pt = 0;
bool f = false;
uint otc = pm->GetObjectTypeCount();
for(uint i = 0; i < otc; ++i){
pt = pm->GetObjectTypeByIndex(i);
uint ic = pt->GetInterfaceCount();
for(uint j = 0; j < ic; ++j)
if(strcmp(pt->GetInterface(j)->GetName(),pintfn) == 0){
f = true;
break;
}
}
if(!f)
return false;
//...
class SpectatorControl : Base::Control::IComponent{
SpectatorControl(Actor @t){
@a = t;
}
//...
Actor @a;
};
Probably not a feature? Or am I failing it again..?
I also tried nesting these methods in SetDefaultNamespace(), but it didn't make any difference.
Without namespaces the method above works correctly.
There is a bug fix in the latest WIP that I believe is related to your problem. Basically, when inheriting from a class or interface in a different namespace, the compiler would compile without error, but would ignore the base class.
The fix is in revision 1388, that was checked in on August 9th.
Allright, updated to r1394 and it works now if I omit namespaces in the name comparison.
So it's
if(strcmp(pt->GetInterface(j)->GetName(),"IComponent") == 0)
instead of
if(strcmp(pt->GetInterface(j)->GetName(),"Base::Control::IComponent") == 0)
Haven't tested yet, but this may cause problems later since there's probably going to be other namespaces with "IComponent" involved in the same script module. But it's working for now, thanks.
//offtopic, can someone up vote first post, my browser hung and after some random clicking to recover/crash it I unintentionally did down vote. And now I see no means to revert this. Sorry for inconvenience