bool_t Json_spew_json(Obj *dump, Folder *folder, const CharBuf *filename) { return (bool_t)Host_callback_i(&JSON, "spew_json", 3, ARG_OBJ("dump", dump), ARG_OBJ("folder", folder), ARG_STR("filename", filename)); }
static QScriptValue js_bind(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_VAR(2, 3); ARG_STRING(0); ARG_OBJ(1); // TBD implement it for testing return QScriptValue(); }
static QScriptValue js_orderDroidObj(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(3); ARG_DROID(0); ARG_ORDER(1); ARG_OBJ(2); return QScriptValue(true); }
static QScriptValue js_removeObject(QScriptContext *context, QScriptEngine *) { ARG_COUNT_VAR(1, 2); ARG_OBJ(0); if (context->argumentCount() > 1) { ARG_BOOL(1); } return QScriptValue(true); }
/// Special scripting function that registers a object-specific timer event. Note: Functions must be passed /// quoted, otherwise they will be inlined! static QScriptValue js_queue(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_VAR(1, 3); ARG_STRING(0); if (context->argumentCount() > 1) ARG_NUMBER(1); if (context->argumentCount() == 3) ARG_OBJ(2); QString funcName = context->argument(0).toString(); // TODO - check that a function by that name exists // TODO - object argument int player = engine->globalObject().property("me").toInt32(); timerNode node(engine, funcName, player); timers.push_back(node); return QScriptValue(); }
CharBuf* Json_to_json(Obj *dump) { return Host_callback_str(&JSON, "to_json", 1, ARG_OBJ("dump", dump)); }
Obj* Json_slurp_json(Folder *folder, const CharBuf *filename) { return Host_callback_obj(&JSON, "slurp_json", 2, ARG_OBJ("folder", folder), ARG_STR("filename", filename)); }