当前位置: 首页>>代码示例>>Java>>正文


Java FileHandle.writeString方法代码示例

本文整理汇总了Java中com.badlogic.gdx.files.FileHandle.writeString方法的典型用法代码示例。如果您正苦于以下问题:Java FileHandle.writeString方法的具体用法?Java FileHandle.writeString怎么用?Java FileHandle.writeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.files.FileHandle的用法示例。


在下文中一共展示了FileHandle.writeString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cleanBundles

import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
public static void cleanBundles(FileHandle file){
    String[] strings = file.readString().split("\n");
    FileHandle out = Gdx.files.absolute("/home/anuke/out.properties");
    out.writeString("", false);
    for(String string : strings){
        if(!string.contains(".description")){
            out.writeString(string + "\n", true);
        }
    }
}
 
开发者ID:Anuken,项目名称:Mindustry,代码行数:11,代码来源:BundleGen.java

示例2: saveToFile

import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
/**
 * save data to file
 * @param data
 * @param handle
 * @return false if handle is directory
 */
public static boolean saveToFile(String data,FileHandle handle) {
	if(handle.isDirectory())
		return false;
	handle.writeString(data, false);
	return true;
}
 
开发者ID:kyperbelt,项目名称:KyperBox,代码行数:13,代码来源:SaveUtils.java

示例3: saveState

import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
/**
 * Saves to a save slot, overwriting any save that existed previously.
 * 
 * @param slot
 *            Slot to save to.
 * @param state
 *            GameStateTEMP to save.
 */
public void saveState(int slot, GameState state) {
	String saveFileName = getSaveFileName(slot);
	FileHandle handle = Gdx.files.internal(saveFileName);

	String gameStateJSON = new Gson().toJson(state);

	// overwrite!
	handle.writeString(gameStateJSON, false);
}
 
开发者ID:mcgeer,项目名称:Climatar,代码行数:18,代码来源:TitleController.java

示例4: save

import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
public static void save () {
    try {
        FileHandle filehandle = Gdx.files.local(file);

        filehandle.writeString(Boolean.toString(backForwardEnabled)+"\n", false);
        filehandle.writeString(Boolean.toString(autoMoveToNext)+"\n", true);
        filehandle.writeString(Integer.toString(bpm)+"\n", true);
    } catch (Throwable e) {
        // Nooooooo... We´ll use defaults next time it starts :/
    }
}
 
开发者ID:B4sileus,项目名称:guitar-finger-trainer,代码行数:12,代码来源:SettingsUtil.java

示例5: buildBundle

import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
public static void buildBundle(FileHandle file){
    BundleGen.file = file;

    file.writeString("", false);
    write("about.text=" + join(Vars.aboutText));
    write("discord.text=Join the mindustry discord!\n[orange]");

    Mathf.each(table -> {
        for(Setting setting : table.getSettings()){
            write("setting." + setting.name + ".name=" + setting.title);
        }
    }, Vars.ui.settings.game, Vars.ui.settings.graphics, Vars.ui.settings.sound);

    for(Map map : Vars.world.maps().list()){
        write("map." + map.name + ".name=" + map.name);
    }
    for(Tutorial.Stage stage : Stage.values()){
        write("tutorial." + stage.name() + ".text=" + stage.text);
    }
    for(Keybind bind : KeyBinds.getSection("default").keybinds.get(DeviceType.keyboard)){
        write("keybind." + bind.name + ".name=" + bind.name);
    }
    for(GameMode mode : GameMode.values()){
        write("mode." + mode.name() + ".name=" + mode.name());
    }
    for(Item item : Item.getAllItems()){
        write("item." + item.name + ".name=" + item.name);
    }
    for(Liquid liquid : Liquid.getAllLiquids()){
        write("liquid." + liquid.name + ".name=" + liquid.name);
    }
    for(Block block : Block.getAllBlocks()){
        write("block." + block.name + ".name=" + block.formalName);
        if(block.fullDescription != null) write("block." + block.name + ".fulldescription=" + block.fullDescription);
        if(block.description != null) write("block." + block.name + ".description=" + block.description);

        Array<String> a = new Array<>();
        block.getStats(a);
        for(String s : a){
            if(s.contains(":")) {
                String color = s.substring(0, s.indexOf("]")+1);
                String first = s.substring(color.length(), s.indexOf(":")).replace("/", "").replace(" ", "").toLowerCase();
                String last = s.substring(s.indexOf(":"), s.length());
                s = color + Bundles.getNotNull("text.blocks." + first) + last;
            }
        }
    }
}
 
开发者ID:Anuken,项目名称:Mindustry,代码行数:49,代码来源:BundleGen.java

示例6: stageToTxt

import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
public String stageToTxt(Stage stage, String name){
    String txt = json.prettyPrint(stage);
    fileHandle = new FileHandle(name);
    fileHandle.writeString(txt, true);
    return txt;
}
 
开发者ID:hypeofpipe,项目名称:Race99,代码行数:7,代码来源:Converter.java

示例7: writeJSON

import com.badlogic.gdx.files.FileHandle; //导入方法依赖的package包/类
public static void writeJSON(FileHandle file) {
    Json json = new Json();
    System.out.println(json.prettyPrint(true));
    file.writeString(json.prettyPrint(true), false);
}
 
开发者ID:justinmarentette11,项目名称:Tower-Defense-Galaxy,代码行数:6,代码来源:FileHandler.java


注:本文中的com.badlogic.gdx.files.FileHandle.writeString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。