| 1291 | } |
| 1292 | |
| 1293 | sp<AEquipment> Agent::getFirstItemInSlot(EquipmentSlotType equipmentSlotType, bool lazy) const |
| 1294 | { |
| 1295 | if (lazy) |
| 1296 | { |
| 1297 | if (equipmentSlotType == EquipmentSlotType::RightHand) |
| 1298 | return rightHandItem; |
| 1299 | if (equipmentSlotType == EquipmentSlotType::LeftHand) |
| 1300 | return leftHandItem; |
| 1301 | } |
| 1302 | for (auto &e : equipment) |
| 1303 | { |
| 1304 | for (auto &s : type->equipment_layout->slots) |
| 1305 | { |
| 1306 | if (s.bounds.p0 == e->equippedPosition && s.type == equipmentSlotType) |
| 1307 | { |
| 1308 | return e; |
| 1309 | } |
| 1310 | } |
| 1311 | } |
| 1312 | return nullptr; |
| 1313 | } |
| 1314 | |
| 1315 | sp<AEquipment> Agent::getFirstItemByType(StateRef<AEquipmentType> equipmentType) const |
| 1316 | { |
no outgoing calls
no test coverage detected