Search in sources :

Example 6 with Game

use of com.github.jakz.romlib.data.game.Game in project rom-manager by Jakz.

the class FindStatement method execute.

public void execute(ScriptEnvironment env) {
    List<Game> roms = env.set.stream().filter(query).collect(Collectors.toList());
    env.out.append("Find found " + roms.size() + " elements:");
    for (Game r : roms) {
        if (!r.getStatus().isComplete())
            env.out.append("  " + r.getTitle());
        else
            env.out.append("  " + r.getTitle());
    }
}
Also used : Game(com.github.jakz.romlib.data.game.Game)

Example 7 with Game

use of com.github.jakz.romlib.data.game.Game in project rom-manager by Jakz.

the class EZFlashIVRomConsolidator method accept.

public void accept(GameEntry handle) {
    try {
        Game rom = handle.getGame();
        Path finalPath = handle.getFinalPath(destination);
        Files.createDirectories(finalPath.getParent());
        if (handle.getPath() == null)
            handle.getBuffer();
        Files.move(handle.getPath(), finalPath, StandardCopyOption.REPLACE_EXISTING);
        // Files.deleteIfExists(handle.getPath());
        Path saverPath = destination.resolve(Paths.get("SAVER")).resolve(rom.getTitle() + ".sav");
        GBA.Save save = rom.getAttribute(GameAttribute.SAVE_TYPE);
        if (!Files.exists(saverPath) && save.getSize() != 0) {
            Files.createDirectories(destination.resolve(Paths.get("SAVER")));
            long fsize = Math.max(save.getSize(), 8192);
            OutputStream wrt = Files.newOutputStream(saverPath, StandardOpenOption.CREATE);
            for (int i = 0; i < fsize; ++i) wrt.write(0xFF);
            wrt.close();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : Path(java.nio.file.Path) Game(com.github.jakz.romlib.data.game.Game) GBA(com.github.jakz.romlib.data.platforms.GBA) OutputStream(java.io.OutputStream)

Aggregations

Game (com.github.jakz.romlib.data.game.Game)7 Feature (com.github.jakz.romlib.data.set.Feature)3 GameSet (com.github.jakz.romlib.data.set.GameSet)3 Main (jack.rm.Main)3 PluginRealType (jack.rm.plugins.PluginRealType)3 Path (java.nio.file.Path)3 Arrays (java.util.Arrays)3 List (java.util.List)3 Set (java.util.Set)3 Asset (com.github.jakz.romlib.data.assets.Asset)2 AssetData (com.github.jakz.romlib.data.assets.AssetData)2 AssetManager (com.github.jakz.romlib.data.assets.AssetManager)2 GameStatus (com.github.jakz.romlib.data.game.GameStatus)2 Attribute (com.github.jakz.romlib.data.game.attributes.Attribute)2 GameAttribute (com.github.jakz.romlib.data.game.attributes.GameAttribute)2 RomAttribute (com.github.jakz.romlib.data.game.attributes.RomAttribute)2 Icon (com.github.jakz.romlib.ui.Icon)2 GameSetManager (jack.rm.data.romset.GameSetManager)2 MyGameSetFeatures (jack.rm.data.romset.MyGameSetFeatures)2 Settings (jack.rm.data.romset.Settings)2