Examples of VarArgFunction


Examples of org.luaj.vm2.lib.VarArgFunction

        }
    }

    private LuaTable luaEntityTable(final String entName, final Entity ent) {
        LuaTable table = new LuaTable();
        table.set("getname", new VarArgFunction() {
            @Override
            public Varargs invoke(Varargs vrgs) {
                return LuaValue.valueOf(entName);
            }
        });
        table.set("getposition", new VarArgFunction() {
            @Override
            public Varargs invoke(Varargs vrgs) {
                return LuaMain.positionToTable(ent.position);//varargsOf(valueOf(ent.position.x), valueOf(ent.position.y));
            }
        });
        table.set("moveTowards", new VarArgFunction() {
            @Override
            public Varargs invoke(Varargs vrgs) {
                level.moveToward(ent.position, level.player.position);
                return NIL;//varargsOf(valueOf(ent.position.x), valueOf(ent.position.y));
            }
        });
        table.set("move", new VarArgFunction() {
            @Override
            public Varargs invoke(Varargs vrgs) {
                level.moveEntity(vrgs.arg1().toString(), entName);
                return NIL;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.