Advertisement

Enumerate factories behaviours

Started by April 04, 2017 07:54 AM
1 comment, last by Alexander Orefkov 7 years, 7 months ago

I create script api dumper and use that code:


for (asUINT m = 0, mc = type->GetBehaviourCount(); m < mc; m++) {
    asEBehaviours bh;
    asIScriptFunction* pM = type->GetBehaviourByIndex(m, &bh);
    if (bh == asBEHAVE_CONSTRUCT || bh == asBEHAVE_DESTRUCT || bh == asBEHAVE_FACTORY)
        Log::WriteRaw(String(pM->GetDeclaration(false, false, true)) + ";\n");
}

But for references types their factories not appear in list.

I explore the code in GetBehaviourByIndex - in behaviours list include only ctors:


	// For reference types, the factories are also stored in the constructor
	// list, so it is sufficient to enumerate only those
	if( index - count < beh.constructors.GetLength() )
	{
		if( outBehaviour ) *outBehaviour = asBEHAVE_CONSTRUCT;
		return engine->scriptFunctions[beh.constructors[index - count]];
	}
	else 
		count += (asUINT)beh.constructors.GetLength();

But I can not find , where the factories is pushed to ctors list.

The factories should be enumerated with asITypeInfo::GetFactoryCount and asITypeInfo::GetFactoryByIndex.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

O, many thanks!

This topic is closed to new replies.

Advertisement