-
Notifications
You must be signed in to change notification settings - Fork 2
CPLUS扩展
jijinlong edited this page Nov 23, 2016
·
3 revisions
class SceneNpc{ public: int talk(Args *stub,Properties &propies) { stub->setNumber("index",1000); //printf("%s %s\n", "print",propies.getString("value").c_str()); this->stub = *stub; return CodeState::NO; } void call() { stub.exec(); } SceneNpc() { } int a; }; LANG_SCRIPT(NPCLIB) { BIND_FUNCTION(SceneNpc,talk); BIND_FIELD(int,SceneNpc,a); BIND_FUNCTION_NAME(SceneNpc,talk,"说话"); }
theLang.readFromFile("test.ai"); Args args; SceneNpc *npc = new SceneNpc(); args.add("o",npc); theLang.exec("start",&args);