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


Java FileHandle.list方法代碼示例

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


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

示例1: getNextModFile

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
@Override
public ModFile getNextModFile() throws IOException {
	FileHandle file = files.pollFirst();
	if (file != null)
		return new FolderModFile(file);
	FileHandle folder = folders.pollFirst();
	if (folder == null)
		return null;
	for (FileHandle f : folder.list()) {
		if (f.isDirectory()) {
			folders.add(f);
		} else {
			files.add(f);
		}
	}
	return new FolderModFile(folder);
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:18,代碼來源:ModInputStream.java

示例2: loadAssets

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public void loadAssets() {
    assetManager.clear();
    
    assetManager.load(DATA_PATH + "/skin/skin.json", Skin.class);
    
    for (String directory : imagePacks.keys()) {
        FileHandle folder = Gdx.files.local(directory);
        for (FileHandle file : folder.list()) {
            assetManager.load(file.path(), Pixmap.class);
            imagePacks.get(directory).add(file.nameWithoutExtension());
        }
    }
    
    assetManager.load(DATA_PATH + "/gfx/white.png", Pixmap.class);
    
    assetManager.load(DATA_PATH + "/sfx/coin.wav", Sound.class);
    assetManager.load(DATA_PATH + "/sfx/hit.wav", Sound.class);
    assetManager.load(DATA_PATH + "/sfx/jump.wav", Sound.class);
}
 
開發者ID:raeleus,項目名稱:bobbybird,代碼行數:20,代碼來源:Core.java

示例3: preloadSfx

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
/**
 * Preloads all sfx for the game prior to execution. This ensures sfx
 * will be heard the first time they are invoked.
 */
private void preloadSfx() {
    FileHandle sfxDirectory = Gdx.files.internal(title + "/sfx");
    for (FileHandle fileHandle: sfxDirectory.list()) {
        loadSfx(fileHandle.path());
    }
}
 
開發者ID:gradualgames,項目名稱:ggvm,代碼行數:11,代碼來源:SoundtrackManager.java

示例4: load

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
private void load(String path) {
    filesView.clearChildren();
    filesView.layout();
    FileHandle file = Gdx.files.absolute(path);
    curFileHandle = file;
    if (file.isDirectory()) {
        for (FileHandle child : file.list()) {
            if (child.name().startsWith(".")) continue;
            loadAsset(child);
        }
    } else {
        loadAsset(file);
    }
}
 
開發者ID:whitecostume,項目名稱:libgdx_ui_editor,代碼行數:15,代碼來源:AssetWindow.java

示例5: getSaves

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public static Save[] getSaves() {
  FileHandle clientSavesFolder = getSavesFolder();
  if (!clientSavesFolder.isDirectory()) return new Save[0];
  FileHandle[] list = clientSavesFolder.list();
  Save[] saves = new Save[list.length];
  for (int i = 0; i < list.length; i++) {
    saves[i] = new Save(list[i].name(), list[i]);
  }
  return saves;
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:11,代碼來源:ClientSaveManager.java

示例6: FolderModInputStream

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public FolderModInputStream(FileHandle file) {
	root = file;
	for (FileHandle f : file.list()) {
		if (f.isDirectory()) {
			folders.add(f);
		} else {
			files.add(f);
		}
	}
}
 
開發者ID:RedTroop,項目名稱:Cubes_2,代碼行數:11,代碼來源:ModInputStream.java

示例7: FolderModInputStream

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public FolderModInputStream(FileHandle file) {
  root = file;
  for (FileHandle f : file.list()) {
    if (f.isDirectory()) {
      folders.add(f);
    } else {
      files.add(f);
    }
  }
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:11,代碼來源:ModInputStream.java

示例8: getNextModFile

import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
@Override
public ModFile getNextModFile() throws IOException {
  FileHandle file = files.pollFirst();
  if (file != null) return new FolderModFile(file);
  FileHandle folder = folders.pollFirst();
  if (folder == null) return null;
  for (FileHandle f : folder.list()) {
    if (f.isDirectory()) {
      folders.add(f);
    } else {
      files.add(f);
    }
  }
  return new FolderModFile(folder);
}
 
開發者ID:RedTroop,項目名稱:Cubes,代碼行數:16,代碼來源:ModInputStream.java


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