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());
}
}
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();
}
}
Aggregations