aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-03-01 22:46:13 +0100
committertomsmeding <tom.smeding@gmail.com>2017-03-01 22:46:13 +0100
commit19fc81c988af048c90ffcc4109c4264da128f978 (patch)
treeca97305c1fdf7100775b6168f0ca04be41ced4a5
parent535848aeafba48cf7c3729fb2e5f15f12acf123a (diff)
Fix warnings; array -> pair
-rw-r--r--main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.cpp b/main.cpp
index 736845a..1f41077 100644
--- a/main.cpp
+++ b/main.cpp
@@ -219,7 +219,7 @@ int main(int argc,char **argv){
vector<Team> teams;
bool opt_pos = false;
- vector<array<int,2>> positions; // TODO: use pair?
+ vector<pair<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.push_back({(int)strtol(argv[i+1],NULL,10), (int)strtol(argv[i+2],NULL,10)}); // TODO: check if i>argc
+ positions.emplace_back((int)strtol(argv[i+1],NULL,10), (int)strtol(argv[i+2],NULL,10)); // TODO: check if i>argc
i += 2;
}
}
- for(int i=0; i<teams.size(); i++) {
+ 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][0], positions[i][1])
+ Robot &r = opt_pos ? world.create(&t,2,t.banks.size(),false, positions[i].first, positions[i].second)
: world.create(&t,2,t.banks.size(),false);
for(int i=0;i<(int)t.banks.size();i++){