-/*
- * Arguments.cpp
- *
- * Created on: Sep 15, 2012
- * Author: holy
- */
-
#include "Arguments.h"
#include <stdexcept>
namespace app {
Arguments::Arguments()
-: outfile(0) {
+: outfile(0)
+, runlevel(PLAY) {
}
char *arg(argv[i]);
if (arg[0] == '-') {
switch (arg[1]) {
+ case 'd':
+ runlevel = DUMP;
+ break;
case 'o':
if (i + 1 >= argc) {
throw std::runtime_error("missing argument to -o");
}
++i;
outfile = argv[i];
+ runlevel = WRITE;
+ break;
+ case 'B':
+ runlevel = BATTLE;
+ break;
+ case 'M':
+ runlevel = MAP;
+ break;
+ case 'S':
+ runlevel = SOURCE_WIKI;
break;
default:
throw std::runtime_error(std::string("unknown option ") + arg[1]);