From 0bf7fd38aea996a381717fe4be09817259575531 Mon Sep 17 00:00:00 2001 From: SemperVinco Date: Wed, 1 Mar 2017 22:24:57 +0100 Subject: Add position argument option -p which places bots in specific locations, syntax: ./sim -p b1.rob 1 2 b2.rob -2 4 --- main.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 36f5580..30002a8 100644 --- a/main.cpp +++ b/main.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -215,14 +216,32 @@ int main(int argc,char **argv){ World world; vector teams; - for(int i=1;i> positions; // TODO: use pair? + + int k = 1; // Increase past options; + + if(string(argv[k]) == "-p") { + opt_pos = true; + k++; + } + + for(int i=k;iargc + i += 2; + } } - for(const Team &t : teams){ - Robot &r=world.create(&t,2,t.banks.size(),false); + for(int i=0; i