🎉 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!

Enumerate factories behaviours

Started by
1 comment, last by Alexander Orefkov 7 years, 2 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.

Advertisement

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

O, many thanks!

This topic is closed to new replies.

Advertisement