本文整理汇总了Java中org.keplerproject.luajava.LuaState.pushJavaObject方法的典型用法代码示例。如果您正苦于以下问题:Java LuaState.pushJavaObject方法的具体用法?Java LuaState.pushJavaObject怎么用?Java LuaState.pushJavaObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.keplerproject.luajava.LuaState
的用法示例。
在下文中一共展示了LuaState.pushJavaObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initLuaContext
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
private void initLuaContext(LuaState luaState){
try {
JavaFunction logfunction = new LogFunctionCallBack(luaState);
logfunction.register("log");
JavaFunction tostringfunction = new ToStringFunctionCallBack(luaState);
tostringfunction.register("tostring");
luaState.pushJavaObject(ModuleContext.getInstance().getAppContext().getApplicationContext());
luaState.setGlobal("context");
luaState.pushJavaObject(ZjDroidLuaJavaAPI.getInstance());
luaState.setGlobal("zjdroid");
} catch (LuaException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例2: main
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public static void main(String[] args) throws LuaException {
LuaState lua = LuaStateFactory.newLuaState();
lua.openLibs();
lua.pushJavaObject(new Thread() {
public void run() {
System.out.println("Lua Thread?");
}
});
lua.setGlobal("t");
int re = lua.LloadString("function f() t:run() return 123 end return f()");
System.out.println(re);
lua.pcall(0, 1, 0);
System.out.println("re="+re);
System.out.println(lua.getTop());
System.out.println(lua.getLuaObject(1).getNumber());
Lang.quiteSleep(2000);
// System.out.println(System.currentTimeMillis());
}
示例3: doLuaAction
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void doLuaAction(String s)
{
Debug.i("chenee", (new StringBuilder()).append("-------------\n").append(s).toString());
Debug.i("chenee", "--------------------\n");
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = LuaManager.getInstance().getLuaState();
luastate.LdoString(s);
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "doAction");
luastate.pushJavaObject(context);
luastate.pushJavaObject(__instance);
luamanager.callLua(2, 0);
}
示例4: callLuaFunc
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void callLuaFunc(String s, EventGameUpdate eventgameupdate)
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), s);
eventgameupdate.getConfigInfo().setLuaAction(context);
luastate.pushJavaObject(DaoManager.getInstance().getLuaListDao());
luastate.pushJavaObject(eventgameupdate.getConfigInfo());
luamanager.callLua(2, 0);
}
示例5: getGameInfo
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public String getGameInfo()
{
setLocale(Locale.getDefault().toString());
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "getGameInfo");
luastate.pushJavaObject(cInfo);
luamanager.callLua(1, 0);
Debug.i("LuaEvent", (new StringBuilder()).append("get lua game info =").append(cInfo.getGameInfo()).toString());
return cInfo.getGameInfo();
}
示例6: getLuaVersion
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public String getLuaVersion()
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "getLuaVersion");
luastate.pushJavaObject(cInfo);
luamanager.callLua(1, 0);
String s = cInfo.getLuaVersion();
Debug.i("LuaEvent", (new StringBuilder()).append("get lua version from local =").append(cInfo.getLuaVersion()).toString());
return s;
}
示例7: setGoal
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void setGoal()
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
de.greenrobot.daobracelet.LuaListDao lualistdao = DaoManager.getInstance().getLuaListDao();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "dayComplete");
luastate.pushJavaObject(lualistdao);
luastate.pushJavaObject(cInfo);
luamanager.callLua(2, 0);
}
示例8: setRecord
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void setRecord(ReportData reportdata)
{
cInfo.setNewRecordReport(reportdata);
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
de.greenrobot.daobracelet.LuaListDao lualistdao = DaoManager.getInstance().getLuaListDao();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "newRecord");
luastate.pushJavaObject(lualistdao);
luastate.pushJavaObject(cInfo);
luamanager.callLua(2, 0);
}
示例9: testAction
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void testAction()
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
LuaAction luaaction = LuaAction.getInstance(context);
de.greenrobot.daobracelet.LuaListDao lualistdao = DaoManager.getInstance().getLuaListDao();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "doAction2");
luastate.pushJavaObject(context);
luastate.pushJavaObject(luaaction);
luastate.pushJavaObject(lualistdao);
luamanager.callLua(3, 0);
}
示例10: luaEventAchievementMsg
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void luaEventAchievementMsg(ConfigDynamicDataInfo configdynamicdatainfo)
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "getAchievementMsgs");
luastate.pushJavaObject(listDao);
luastate.pushJavaObject(configdynamicdatainfo);
luamanager.callLua(2, 0);
}
示例11: luaEventActivityMsg
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void luaEventActivityMsg(ConfigDynamicDataInfo configdynamicdatainfo)
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "getActivityMsgs");
luastate.pushJavaObject(listDao);
luastate.pushJavaObject(configdynamicdatainfo);
luamanager.callLua(2, 0);
}
示例12: luaEventDefaultMsg
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void luaEventDefaultMsg(ConfigDynamicDataInfo configdynamicdatainfo)
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "getDefaultMsgs");
luastate.pushJavaObject(listDao);
luastate.pushJavaObject(configdynamicdatainfo);
luamanager.callLua(2, 0);
}
示例13: luaEventSleepMsg
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void luaEventSleepMsg(ConfigDynamicDataInfo configdynamicdatainfo)
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "getSleepMsgs");
luastate.pushJavaObject(listDao);
luastate.pushJavaObject(configdynamicdatainfo);
luamanager.callLua(2, 0);
}
示例14: luaEventSysInfoMsg
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void luaEventSysInfoMsg(ConfigDynamicDataInfo configdynamicdatainfo)
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "getSysInfoMsgs");
luastate.pushJavaObject(listDao);
luastate.pushJavaObject(configdynamicdatainfo);
luamanager.callLua(2, 0);
}
示例15: testLuaImp
import org.keplerproject.luajava.LuaState; //导入方法依赖的package包/类
public void testLuaImp(int i, ConfigDynamicDataInfo configdynamicdatainfo)
{
LuaManager luamanager = LuaManager.getInstance();
LuaState luastate = luamanager.getLuaState();
luastate.getField(LuaState.LUA_GLOBALSINDEX.intValue(), "getEventMsgs");
luastate.pushJavaObject(listDao);
luastate.pushJavaObject(configdynamicdatainfo);
luastate.pushInteger(i);
luamanager.callLua(3, 0);
}