Search in sources :

Example 1 with CCCommandWrapper

use of logisticspipes.proxy.cc.wrapper.CCCommandWrapper in project LogisticsPipes by RS485.

the class LPASMHookCC method onCCWrappedILuaObject.

public static LuaTable onCCWrappedILuaObject(final LuaTable table, final ILuaObject object) {
    if (object instanceof CCCommandWrapper) {
        LuaTable lpTable = new LPLuaTable((CCCommandWrapper) object);
        LuaValue k = LuaValue.NIL;
        while (true) {
            Varargs n = table.next(k);
            if ((k = n.arg1()).isnil()) {
                break;
            }
            LuaValue v = n.arg(2);
            lpTable.set(k, v);
        }
        ((CCCommandWrapper) object).table = lpTable;
        return lpTable;
    }
    return table;
}
Also used : LuaTable(org.luaj.vm2.LuaTable) CCCommandWrapper(logisticspipes.proxy.cc.wrapper.CCCommandWrapper) Varargs(org.luaj.vm2.Varargs) LuaValue(org.luaj.vm2.LuaValue)

Aggregations

CCCommandWrapper (logisticspipes.proxy.cc.wrapper.CCCommandWrapper)1 LuaTable (org.luaj.vm2.LuaTable)1 LuaValue (org.luaj.vm2.LuaValue)1 Varargs (org.luaj.vm2.Varargs)1