當前位置: 首頁>>代碼示例>>Java>>正文


Java Files.internal方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.Files.internal方法的典型用法代碼示例。如果您正苦於以下問題:Java Files.internal方法的具體用法?Java Files.internal怎麽用?Java Files.internal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.Files的用法示例。


在下文中一共展示了Files.internal方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Configuration

import com.badlogic.gdx.Files; //導入方法依賴的package包/類
private Configuration(final Files files, final String moduleName) {
	if (configuration != null) {
		this.options = configuration.options;
	} else {
		loadOptions(files);
	}
	configuration = this;
	this.moduleName = moduleName;
	this.moduleFolder = FOLDER_MODULES + moduleName + "/";
	String file = moduleFolder + "config.xml";
	try {
		loadFromXML(files.internal(file));
		loadingScreensConfiguration = new LoadingScreens(files.internal(Configuration.getFolderUI()
				+ "loadingScreens.xml"));
	} catch (final IOException e) {
		throw new GdxRuntimeException("Cannot read configuration file " + file + ", aborting.", e);
	}
}
 
開發者ID:mganzarcik,項目名稱:fabulae,代碼行數:19,代碼來源:Configuration.java

示例2: main

import com.badlogic.gdx.Files; //導入方法依賴的package包/類
public static void main(String[] args) {
	if (args.length != 2) {
		System.err.println("Shadow Engine TMX to SMF converter");
		System.err.println("Version: Don't even ask me.");
		System.err.println("Usage: <process> <input> <output>");
		return;
	}

	LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
	cfg.title = "shadow-tmx-to-smf";
	cfg.useGL30 = false;
	cfg.width = 600;
	cfg.height = 480;

	Files files = new LwjglFiles();

	FileHandle input = files.internal(args[0]);
	if (!input.exists()) {
		input = files.absolute(args[0]);
	}
	if (input != null && !input.exists()) {
		System.err.println("Input file doesn't exist internally nor absolutely!");
		return;
	}

	FileHandle output = files.absolute(args[1]);

	Converter converter = new Converter(input, output);

	Converter.list.add(converter);
	Converter.convertOnly = true;

	BackendHelper.backend = new LWJGLBackend(cfg);
	new LwjglApplication(new Shadow(), cfg);
}
 
開發者ID:0x0ade,項目名稱:shadow-engine,代碼行數:36,代碼來源:ConverterLauncher.java

示例3: main

import com.badlogic.gdx.Files; //導入方法依賴的package包/類
public static void main(String[] args) {
	System.out.println("Generating Field classes ...");
	System.out.println();
	Files files = new LwjglFiles();
	Json json = new Json();
	FileHandle dir = files.internal(REPOCOMPONENTS_MAIN_PATH);
	// Generate fields classes for all repo classes
	buildCodeForAllClasses(files, json, dir, SCHEMAX_REPO_PACKAGE,
			EDITOR_SCHEMA_DESTFOLDER);
}
 
開發者ID:e-ucm,項目名稱:ead,代碼行數:11,代碼來源:GenerateFieldClasses.java

示例4: buildCode

import com.badlogic.gdx.Files; //導入方法依賴的package包/類
private static String buildCode(Files files, Json json,
		String originJsonSchemaPath, String targetPackageName,
		String targetDirectory, boolean mainClass) {
	FileHandle fh = files.internal(originJsonSchemaPath);

	JsonValue next = json.fromJson(null, null, fh);
	next = next.child();

	String fieldsCode = "";
	String headerCode = "";
	String targetClassName = "";
	while ((next = next.next()) != null) {
		if (next.name().equals("properties")) {
			JsonValue nextProperty = next.child();
			fieldsCode += buildFields(nextProperty);
			break;
		} else if (next.name().equals("extends")) {
			String relativeParentJsonSchemaPath = next.child().asString();
			// Calculate directory to find parent class
			String parentJsonSchemaPath = originJsonSchemaPath.substring(0,
					originJsonSchemaPath.lastIndexOf("/") + 1)
					+ relativeParentJsonSchemaPath;
			fieldsCode += buildCode(files, json, parentJsonSchemaPath,
					null, null, false);
		} else if (next.name().equals("javaType") && mainClass) {
			String javaType = next.asString();
			String originalClassName = javaType.substring(
					javaType.lastIndexOf(".") + 1, javaType.length());
			targetClassName = originalClassName + "Fields";
			headerCode = getClassHeader(originalClassName,
					targetPackageName, targetClassName);
		}
	}

	if (mainClass) {
		if (fieldsCode.length() > 0) {
			System.out.println("Generating code for class "
					+ targetClassName);
			String classCode = headerCode + fieldsCode + "}";
			writeClass(files, classCode, targetPackageName,
					targetClassName, targetDirectory);
			return classCode;
		} else {
			System.out.println("Skipping class " + targetClassName
					+ " (no properties)");
			return "";
		}
	} else {
		return fieldsCode;
	}
}
 
開發者ID:e-ucm,項目名稱:ead,代碼行數:52,代碼來源:GenerateFieldClasses.java


注:本文中的com.badlogic.gdx.Files.internal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。