14 string Game::worlddir;
15 string Game::logfile_path;
23 void Game::log(string text, int level){
36 color = CODE_LIGHTBLUE;
48 cout << "\e[3" << color << "m" << "[" << prefix << "] \e[0m" << text << endl;
50 fprintf(logfile, "[%s] %s\n", prefix.c_str(), text.c_str());
52 void Game::log(string text){
56 cout << "Usage: " << argv[0] << "[OPTIONS]" << endl;
57 cout << "Options:" << endl;
58 cout << "\t" << "-h" << "\t" << "--help" << "\t\t\t" << "Display this help and exit." << endl;
59 cout << "\t" << "-v" << "\t" << "--version" << "\t\t" << "Display version info." << endl;
60 cout << "\t" << "-p" << "\t" << "--worldpath [PATH]" << "\t" << "Set world path." << endl;
61 cout << "\t" << "-w" << "\t" << "--worldname [PATH]" << "\t" << "Select world by name (Worlds are placed in ~/.dragonblocks/worlds/)." << endl;
62 cout << "\t" << "-r" << "\t" << "--worldlist" << "\t\t" << "Show a list of your worlds." << endl;
63 cout << "\t" << "-s" << "\t" << "--seed [NUMBER]" << "\t\t" << "Set seed." << endl;
64 cout << "\t" << "-l" << "\t" << "--logfile [PATH]" << "\t" << "Set logfile." << endl;
67 cout << "DRAGONBLOCKS BEDROCK EDITION" << endl;
68 cout << "Written in C++" << endl;
69 cout << "An Open Source Project by Elias Fleckenstein" << endl;
70 cout << "Dragonblocks " << VERSION << endl;
72 void Game::worldlist(){
74 DIR *folder = opendir((userdir + "/worlds/").c_str());;
76 Game::log("Cant Open World Directory", ERROR);
81 while(entry = readdir(folder))
84 if(entry->d_name[0] != '.')
85 cout << "\t" << entry->d_name << endl;