Example #1
0
        public void SetMetatable(int idx)
        {
            var val   = _stack.Get(idx);
            var mtVal = _stack.Pop();

            switch (mtVal)
            {
            case null:
                LuaValue.SetMetatable(val, null, this);
                break;

            case LuaTable mtl:
                LuaValue.SetMetatable(val, mtl, this);
                break;

            default:
                throw new Exception("table expected!");     // todo
            }
        }