• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LuaUserdata类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.luaj.vm2.LuaUserdata的典型用法代码示例。如果您正苦于以下问题:Java LuaUserdata类的具体用法?Java LuaUserdata怎么用?Java LuaUserdata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LuaUserdata类属于org.luaj.vm2包,在下文中一共展示了LuaUserdata类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: makeInheritanceMap

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
/**
 * Lua Closure for MappingFactory.makeInheritanceMap(jarFile, mappingArg)
 * @param jarFile Jar file to make the inheritance map for.
 * @param mappingArg Mappings to make the inheritance map for. The inheritance map will only contains symbols also contained in this mapping.
 * @return
 */
private static final LuaValue makeInheritanceMap(String jarFile, SrgMapping mapping)
{
	File inputJar = new File(jarFile);

	try
	{
		Jar inJar = Jar.init(inputJar);
		
		SrgInheritanceMap inheritMap = new SrgInheritanceMap(new JarProvider(inJar), mapping);
		
		return new LuaUserdata(inheritMap, SrgInheritanceMapMeta.getMetaTable());
	}
	catch (Exception e)
	{
		throw new LuaError(e);
	}
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:24,代码来源:MappingLib.java


示例2: loadInheritanceMap

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
/**
 * Lua Closure for MappingFactory.loadInheritanceMap(filename[, filename[, filename[, ...]]])
 * @param filenames The inheritance maps to load.
 * @return
 */
private static final LuaValue loadInheritanceMap(Varargs filenames)
{
	SrgInheritanceMap inheritance = new SrgInheritanceMap();
	
	int args = filenames.narg() + 1;
	for (int i = 1; i != args; ++i)
	{
		String filename = filenames.arg(i).checkjstring();

		File file = new File(filename);
		if (!file.exists())
			throw new LuaError("File " + filename + " does not exist.");

		try
		{
			inheritance.loadMapping(file);
		}
		catch (Exception e)
		{
			throw new LuaError(e);
		}
	}
	
	return new LuaUserdata(inheritance, SrgInheritanceMapMeta.getMetaTable());
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:31,代码来源:MappingLib.java


示例3: invoke

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
public Varargs invoke(Varargs args) {
    Object o = args.checkuserdata(1);
    LuaValue v = args.checkvalue(2);
    LuaUserdata u = (LuaUserdata) args.arg1();
    u.m_instance = v.checkuserdata();
    u.m_metatable = v.getmetatable();
    return NONE;
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:9,代码来源:DebugLib.java


示例4: invoke

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
public Varargs invoke(Varargs args) {
	Object o = args.checkuserdata(1);
	LuaValue v = args.checkvalue(2);
	LuaUserdata u = (LuaUserdata) args.arg1();
	u.m_instance = v.checkuserdata();
	u.m_metatable = v.getmetatable();
	return NONE;
}
 
开发者ID:hsllany,项目名称:HtmlNative,代码行数:9,代码来源:DebugLib.java


示例5: invoke

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
@Override
public Varargs invoke(Varargs arguments) {
	BlocksItems.load();
	if (arguments.isstring(1)) {
		LuaUserdata u = blocksItems.blockUserdata.get(arguments.checkjstring(1));
		return u != null ? u : NIL;
	} else {
		return BlocksItems.blockTable;
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:11,代码来源:LuaMappingCubes.java


示例6: call

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
@Override
public LuaValue call(LuaValue gb1, LuaValue gb2, LuaValue gb3) {
	int x = gb1.checkint();
	int y = gb2.checkint();
	int z = gb3.checkint();
	return new LuaUserdata(world.getBlock(x, y, z));
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:8,代码来源:LuaMappingWorld.java


示例7: invoke

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
@Override
public Varargs invoke(Varargs args) {
  BlocksItems.load();
  if (args.isstring(1)) {
    LuaUserdata u = BlocksItems.blockUserdata.get(args.checkjstring(1));
    return u != null ? u : NIL;
  } else {
    return BlocksItems.blockTable;
  }
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:11,代码来源:LuaMappingCubes.java


示例8: call

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
@Override
public LuaValue call(LuaValue arg1, LuaValue arg2, LuaValue arg3) {
  int x = arg1.checkint();
  int y = arg2.checkint();
  int z = arg3.checkint();
  return new LuaUserdata(world.getBlock(x, y, z));
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:8,代码来源:LuaMappingWorld.java


示例9: invoke

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
public Varargs invoke(Varargs args) {
	Object o = args.checkuserdata(1);
	LuaValue v = args.checkvalue(2);
	LuaUserdata u = (LuaUserdata)args.arg1();
	u.m_instance = v.checkuserdata();
	u.m_metatable = v.getmetatable();
	return NONE;
}
 
开发者ID:Cephrus,项目名称:Elite-Armageddon,代码行数:9,代码来源:DebugLib.java


示例10: entries

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
private static LuaValue entries(ZipFile instance)
{		
	Enumeration<? extends ZipEntry> files = instance.entries();
	LuaTable fileTable = new LuaTable();		
	int i = 1;
	while (files.hasMoreElements())
	{
		ZipEntry entry = files.nextElement();
		
		fileTable.set(i++, new LuaUserdata(entry, ZipEntryMeta.getMetaTable()));
	}
	
	return fileTable;
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:15,代码来源:ZipFileMeta.java


示例11: getEntry

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
private static LuaValue getEntry(ZipFile instance, String path)
{		
	ZipEntry entry = instance.getEntry(path);
	
	if (entry == null)
		return LuaValue.NONE;
	else
		return new LuaUserdata(entry, ZipEntryMeta.getMetaTable());
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:10,代码来源:ZipFileMeta.java


示例12: open

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
private static LuaValue open(String path)
{
	try
	{
		return new LuaUserdata(new ZipFile(new File(path)), ZipFileMeta.getMetaTable());
	}
	catch (Exception e)
	{
		throw new LuaError(e);
	}
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:12,代码来源:ZipLib.java


示例13: loadSrgMapping

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
/**
 * Lua Closure for MappingFactory.loadSrg(filename, ...).
 * Loads all specified srg files into a single srg mapping.
 * 
 * @param filenames The filenames to load
 * @return The SrgMapping (as UserData)
 */
private static LuaValue loadSrgMapping(Varargs filenames)
{
	
	SrgMapping mapping = new SrgMapping();
	
	int args = filenames.narg() + 1;
	for (int i = 1; i != args; ++i)
	{
		String filename = filenames.arg(i).checkjstring();

		File file = new File(filename);
		if (!file.exists())
			throw new LuaError("File " + filename + " does not exist.");

		try
		{
			mapping.loadMapping(file);
		}
		catch (Exception e)
		{
			throw new LuaError(e);
		}
	}
	
	return new LuaUserdata(mapping, SrgMappingMeta.getMetaTable());
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:34,代码来源:MappingLib.java


示例14: loadMCPMapping

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
/**
 * Lua Closure for MappingFactory.loadMCP(fieldsFile, methodsFile, packagesFile).
 * Loads the specified MCP csv files into a mapping. 
 * @param fieldsFile The fields.csv file, or nil to ignore field mappings.
 * @param methodsFile The methods.csv file, or nil to ignore method mappings.
 * @param packagesFile The packages.csv file, or nil to ignore package mappings.
 * @return The MinecraftCodersPackMapping (as UserData)
 */
private static final LuaValue loadMCPMapping(LuaValue fieldsFile, LuaValue methodsFile, LuaValue packagesFile)
{
	File fields = fieldsFile.isnil() ? null : new File(fieldsFile.checkjstring());
	File methods = methodsFile.isnil() ? null : new File(methodsFile.checkjstring());
	File packages = packagesFile.isnil() ? null : new File(packagesFile.checkjstring());
	
	if (fields != null && fields.exists() == false)
		throw new LuaError("File " + fields.getAbsolutePath() + " does not exist.");
	
	if (methods != null && methods.exists() == false)
		throw new LuaError("File " + fields.getAbsolutePath() + " does not exist.");
	
	if (packages != null && packages.exists() == false)
		throw new LuaError("File " + fields.getAbsolutePath() + " does not exist.");
	

	try
	{
		MinecraftCodersPackMapping mapping = new MinecraftCodersPackMapping(fields, methods, packages);
		return new LuaUserdata(mapping);
	}
	catch (Exception e)
	{
		throw new LuaError(e);
	}
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:35,代码来源:MappingLib.java


示例15: call

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
public LuaValue call(LuaValue u) {
	return LuaValue.valueOf(Array.getLength(((LuaUserdata)u).m_instance));
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:4,代码来源:JavaArray.java


示例16: clone

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
private static LuaValue clone(SrgMapping instance)
{
	return new LuaUserdata(instance.clone(), SrgMappingMeta.getMetaTable());
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:5,代码来源:SrgMappingMeta.java


示例17: reverse

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
private static LuaValue reverse(SrgMapping instance)
{
	return new LuaUserdata(instance.reverse(), SrgMappingMeta.getMetaTable());
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:5,代码来源:SrgMappingMeta.java


示例18: identity

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
private static LuaValue identity(SrgMapping instance)
{
	return new LuaUserdata(instance.identity(), SrgMappingMeta.getMetaTable());
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:5,代码来源:SrgMappingMeta.java


示例19: transform

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
private static LuaValue transform(SrgMapping instance, MappingTransformer inputTransformer, MappingTransformer outputTransformer)
{
	return new LuaUserdata(instance.transform(inputTransformer, outputTransformer), SrgMappingMeta.getMetaTable());
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:5,代码来源:SrgMappingMeta.java


示例20: clone

import org.luaj.vm2.LuaUserdata; //导入依赖的package包/类
private static LuaValue clone(SrgInheritanceMap instance)
{
	return new LuaUserdata(instance.clone(), SrgInheritanceMapMeta.getMetaTable());
}
 
开发者ID:Lrns123,项目名称:SrgUtility,代码行数:5,代码来源:SrgInheritanceMapMeta.java



注:本文中的org.luaj.vm2.LuaUserdata类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EditText类代码示例发布时间:2022-05-22
下一篇:
Java AvroSource类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap