#include #include #include #include #include #include #include #include #include #include "params.h" #include "world.h" #include "parse.h" #ifndef _WIN32 # include #endif using namespace std; static ScreenBuffer *sb; #ifndef _WIN32 static void signalHandler(int sig){ if(sig==SIGINT){ sb->emergencyDeinit(); _exit(130); } } #endif struct RobotSpec{ string fname; bool random; int x,y,heading; }; int parseInt(const char *str){ char *endp; int v=strtol(str,&endp,10); if(str[0]=='\0'||*endp!='\0'){ cerr<<"Invalid number '"<]* [-p ]* " <<"[-s ] [-t] [-B]"< teams; vector robotSpecs; int sleeptime=3000; bool step = false; bool batch = false; if(argc<=1){ usage(argv); return 1; } for(int i=1;i=argc-1){ cerr<<"Expected file name after '-r'"<=argc-4){ cerr<<"Expected file name, x, y and heading after '-p'"<=argc-1){ cerr<<"Expected sleep time after '-s'"<active){ haveActive=true; break; } } if(!haveActive)break; } for(int y=0;yteam<<' ' <heading<draw(); for(int i=0;imvprintf(0, SIZE, "step: %5i", i+2); sb->draw(); } } delete sb; }