예제 #1
0
        private void PushArgs(object[] args)
        {
            LogErr(CppDll.EBClearArgBuff());
            if (args == null)
            {
                return;
            }

            for (int i = 0; i < args.Length; ++i)
            {
                object o = args[i];
                Type   t = o.GetType();
                if (t == typeof(string))
                {
                    string s = (string)o;
                    if (s.Contains(OBJ_PREFIX))
                    {
                        LogErr(CppDll.EBPushObject(s.Substring(OBJ_PREFIX.Length)));
                    }
                    else
                    {
                        LogErr(CppDll.EBPushString(s));
                    }
                }
                else if (t == typeof(bool))
                {
                    LogErr(CppDll.EBPushBool((bool)o));
                }
                else if (t == typeof(double))
                {
                    LogErr(CppDll.EBPushDouble((double)o));
                }
                else
                {
                    LogErr("Unknow arg type: " + o.ToString());
                }
            }
        }