aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorSemperVinco <w.deweijer@hotmail.com>2017-03-01 23:51:26 +0100
committerSemperVinco <w.deweijer@hotmail.com>2017-03-01 23:51:26 +0100
commitfea3a0eed32db67ef435e7317727ca27f93ae31a (patch)
tree3899dd231b4742a520591ec7fa785e99155cc07f /main.cpp
parent19fc81c988af048c90ffcc4109c4264da128f978 (diff)
include heading in -p option, pair -> tuple
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.cpp b/main.cpp
index 1f41077..3072f57 100644
--- a/main.cpp
+++ b/main.cpp
@@ -5,7 +5,7 @@
#include <unordered_map>
#include <unistd.h>
#include <cstdlib>
-#include <array>
+#include <tuple>
#include <cctype>
#include <cassert>
#include <sys/time.h>
@@ -219,7 +219,7 @@ int main(int argc,char **argv){
vector<Team> teams;
bool opt_pos = false;
- vector<pair<int,int>> positions;
+ vector<tuple<int,int,int>> positions;
int k = 1; // Increase past options;
@@ -233,14 +233,14 @@ int main(int argc,char **argv){
assert(f);
teams.push_back(assemble(preprocess(f)));
if(opt_pos) {
- positions.emplace_back((int)strtol(argv[i+1],NULL,10), (int)strtol(argv[i+2],NULL,10)); // TODO: check if i>argc
- i += 2;
+ positions.emplace_back((int)strtol(argv[i+1],NULL,10), (int)strtol(argv[i+2],NULL,10), (int)strtol(argv[i+3],NULL,10)); // TODO: check if i>argc
+ i += 3;
}
}
for(int i=0; i<(int)teams.size(); i++) {
const Team &t = teams[i];
- Robot &r = opt_pos ? world.create(&t,2,t.banks.size(),false, positions[i].first, positions[i].second)
+ Robot &r = opt_pos ? world.create(&t,2,t.banks.size(),false, get<0>(positions[i]), get<1>(positions[i]), get<2>(positions[i]))
: world.create(&t,2,t.banks.size(),false);
for(int i=0;i<(int)t.banks.size();i++){