@@ -130,21 +130,19 @@ namespace
130
130
131
131
void pushAgingRobotMessage (const Robot* robot, const MapCoordinate& position, NotificationArea& notificationArea)
132
132
{
133
- const auto robotLocationText = " (" + std::to_string (position.xy .x ) + " , " + std::to_string (position.xy .y ) + " )" ;
134
-
135
133
if (robot->fuelCellAge () == 190 ) // FIXME: magic number
136
134
{
137
135
notificationArea.push ({
138
136
" Aging Robot" ,
139
- " Robot '" + robot->name () + " ' at location " + robotLocationText + " is approaching its maximum age." ,
137
+ " Robot '" + robot->name () + " ' at location " + std::string{position. xy } + " is approaching its maximum age." ,
140
138
position,
141
139
NotificationArea::NotificationType::Warning});
142
140
}
143
141
else if (robot->fuelCellAge () == 195 ) // FIXME: magic number
144
142
{
145
143
notificationArea.push ({
146
144
" Aging Robot" ,
147
- " Robot '" + robot->name () + " ' at location " + robotLocationText + " will fail in a few turns. Replace immediately." ,
145
+ " Robot '" + robot->name () + " ' at location " + std::string{position. xy } + " will fail in a few turns. Replace immediately." ,
148
146
position,
149
147
NotificationArea::NotificationType::Critical});
150
148
}
@@ -1115,7 +1113,7 @@ void MapViewState::placeRobodigger(Tile& tile)
1115
1113
const auto position = tile.xy ();
1116
1114
mNotificationArea .push ({
1117
1115
" Mine destroyed" ,
1118
- " Digger destroyed a Mine at ( " + std::to_string ( position. x ) + " , " + std::to_string (position. y ) + " ) ." ,
1116
+ " Digger destroyed a Mine at " + std::string{ position} + " ." ,
1119
1117
tile.xyz (),
1120
1118
NotificationArea::NotificationType::Information});
1121
1119
mTileMap ->removeMineLocation (position);
@@ -1293,20 +1291,18 @@ void MapViewState::updateRobots()
1293
1291
1294
1292
if (robot->isDead ())
1295
1293
{
1296
- const auto robotLocationText = " (" + std::to_string (position.xy .x ) + " , " + std::to_string (position.xy .y ) + " )" ;
1297
-
1298
1294
if (robot->selfDestruct ())
1299
1295
{
1300
1296
mNotificationArea .push ({
1301
1297
" Robot Self-Destructed" ,
1302
- robot->name () + " at location " + robotLocationText + " self destructed." ,
1298
+ robot->name () + " at location " + std::string{position. xy } + " self destructed." ,
1303
1299
position,
1304
1300
NotificationArea::NotificationType::Critical
1305
1301
});
1306
1302
}
1307
1303
else if (robot->type () != Robot::Type::Miner)
1308
1304
{
1309
- const auto text = " Your " + robot->name () + " at location " + robotLocationText + " has broken down. It will not be able to complete its task and will be removed from your inventory." ;
1305
+ const auto text = " Your " + robot->name () + " at location " + std::string{position. xy } + " has broken down. It will not be able to complete its task and will be removed from your inventory." ;
1310
1306
mNotificationArea .push ({" Robot Broke Down" , text, position, NotificationArea::NotificationType::Critical});
1311
1307
robot->abortTask (*tile);
1312
1308
}
@@ -1329,7 +1325,7 @@ void MapViewState::updateRobots()
1329
1325
1330
1326
mNotificationArea .push ({
1331
1327
" Robot Task Completed" ,
1332
- robot->name () + " completed its task at ( " + std::to_string ( tile->xy (). x ) + " , " + std::to_string (tile-> xy (). y ) + " ) ." ,
1328
+ robot->name () + " completed its task at " + std::string{ tile->xy ()} + " ." ,
1333
1329
tile->xyz (),
1334
1330
NotificationArea::NotificationType::Success
1335
1331
});
@@ -1344,7 +1340,7 @@ void MapViewState::updateRobots()
1344
1340
1345
1341
mNotificationArea .push ({
1346
1342
" Robot Task Canceled" ,
1347
- robot->name () + " canceled its task at ( " + std::to_string ( tile->xy (). x ) + " , " + std::to_string (tile-> xy (). y ) + " ) ." ,
1343
+ robot->name () + " canceled its task at " + std::string{ tile->xy ()} + " ." ,
1348
1344
tile->xyz (),
1349
1345
NotificationArea::NotificationType::Information
1350
1346
});
0 commit comments