I'm not sure if this is gonna work. I can't figure out how to do something as simple as passing the newly created cPlugin to cPluginManager::AddPlugin() as a pointer or whatever.
But what worries me most is that Squirrel has no idea of the underlaying inheritance of classes, I mean I might export cSpider to Squirrel, but how does Squirrel know it extends cMonster or even cEntity? You won't be able to call the most basic functions such as GetPosition() without casting to a cEntity (if that is even possible)
In case you're wondering, Lua DOES know about the inheritance of the classes by using tolua_cclass(...), looks like this:
This tells Lua cPickup extends cEntity, and the same is done for cSpider -> cMonster and cMonster -> cEntity, this way Lua knows cSpider is a cEntity
EDIT:
Nvm, Squirrel does know this. However I'm still stuck XD
But what worries me most is that Squirrel has no idea of the underlaying inheritance of classes, I mean I might export cSpider to Squirrel, but how does Squirrel know it extends cMonster or even cEntity? You won't be able to call the most basic functions such as GetPosition() without casting to a cEntity (if that is even possible)
In case you're wondering, Lua DOES know about the inheritance of the classes by using tolua_cclass(...), looks like this:
Code:
tolua_cclass(tolua_S,"cPickup","cPickup","cEntity",tolua_collect_cPickup);
This tells Lua cPickup extends cEntity, and the same is done for cSpider -> cMonster and cMonster -> cEntity, this way Lua knows cSpider is a cEntity
EDIT:
Nvm, Squirrel does know this. However I'm still stuck XD