Rogue: Savage Rats, a retro-themed dungeon crawler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rogue-savage-rats/src/mightypork/rogue/Launcher.java

54 lines
991 B

package mightypork.rogue;
import java.io.File;
import java.util.Arrays;
import mightypork.gamecore.core.BaseApp;
import mightypork.gamecore.logging.Log;
import mightypork.gamecore.util.files.OsUtils;
public class Launcher {
/**
* Launcher
*
* @param args
*/
public static void main(String[] args)
{
Log.f3(Arrays.toString(args));
File workdir = null;
try {
boolean localWorkdir = false;
String lwdDir = null;
for (int i = 0; i < args.length; i++) {
if (args[i].equals("--workdir") || args[i].equals("-w")) {
localWorkdir = true;
lwdDir = args[i + 1];
i++;
}
}
if (!localWorkdir) {
workdir = OsUtils.getHomeWorkDir(".rogue-save");
} else {
workdir = new File(lwdDir);
}
} catch (final ArrayIndexOutOfBoundsException e) {
Log.e("Malformed arguments.");
}
final BaseApp app = new RogueApp(workdir, true);
// configure the app
app.opt().setBusLogging(true);
app.start();
}
}