rootobjecti.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <precomp.h>
  2. //<?#include "<class data="implementationheader"/>"
  3. #include "rootobjecti.h"
  4. //?>
  5. #include <bfc/wasabi_std.h>
  6. #include <api/script/scriptmgr.h>
  7. #include <api/script/scriptobj.h>
  8. #include <bfc/foreach.h>
  9. // --------------------------------------------------------------------------------------------
  10. RootObjectI::RootObjectI(ScriptObject *o) {
  11. my_script_object = o;
  12. }
  13. RootObjectI::~RootObjectI() {
  14. }
  15. const wchar_t *RootObjectI::rootobject_getClassName()
  16. {
  17. if (!my_script_object) return NULL;
  18. return my_script_object->vcpu_getClassName();
  19. }
  20. void RootObjectI::rootobject_notify(const wchar_t *s, const wchar_t *t, int u, int v) {
  21. foreach(cbs)
  22. cbs.getfor()->rootobjectcb_onNotify(s, t, u, v);
  23. endfor;
  24. RootObject_ScriptMethods::onNotify(SCRIPT_CALL, rootobject_getScriptObject(), MAKE_SCRIPT_STRING(s), MAKE_SCRIPT_STRING(t), MAKE_SCRIPT_INT(u), MAKE_SCRIPT_INT(v));
  25. }
  26. ScriptObject *RootObjectI::rootobject_getScriptObject() {
  27. return my_script_object;
  28. }
  29. void RootObjectI::rootobject_setScriptObject(ScriptObject *obj) {
  30. my_script_object = obj;
  31. }
  32. void RootObjectI::rootobject_addCB(RootObjectCallback *cb) {
  33. cbs.addItem(cb);
  34. }