Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int entityCount; // number of entities visible to you
- int radarCooldown; // turns left until a new radar can be requested
- int trapCooldown; // turns left until a new trap can be requested
- cin >> entityCount >> radarCooldown >> trapCooldown; cin.ignore();
- for (int i = 0; i < entityCount; i++) {
- int id; // unique id of the entity
- int type; // 0 for your robot, 1 for other robot, 2 for radar, 3 for trap
- int x;
- int y; // position of the entity
- int item; // if this entity is a robot, the item it is carrying (-1 for NONE, 2 for RADAR, 3 for TRAP, 4 for ORE)
- cin >> id >> type >> x >> y >> item; cin.ignore();
- if(type == 0) myRobots.push_back({id,x,y,item});
- if(type == 1) enRobots.push_back({id,x,y,item});
- if(type == 2) {
- radars.push_back({id,x,y,item});
- for(int j = 0; j < radarsPlaces.size(); j++)
- {
- if(x == radarsPlaces[j].x && y == radarsPlaces[j].y)
- {
- radarsPlaces[j].radar = true;
- }
- }
- }
- if(type == 3) traps.push_back({id,x,y,item});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement