| 138 | } |
| 139 | |
| 140 | void DamageManager::pushRemoteDamageRequest(RemoteDamageRequest const& remoteDamageRequest) { |
| 141 | if (remoteDamageRequest.destinationConnection() != m_connectionId) |
| 142 | throw StarException("RemoteDamageRequest routed to wrong DamageManager"); |
| 143 | |
| 144 | if (auto targetEntity = m_world->entity(remoteDamageRequest.targetEntityId)) { |
| 145 | starAssert(targetEntity->isMaster()); |
| 146 | for (auto& damageNotification : targetEntity->applyDamage(remoteDamageRequest.damageRequest)) |
| 147 | addDamageNotification({remoteDamageRequest.damageRequest.sourceEntityId, std::move(damageNotification)}); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | void DamageManager::pushRemoteDamageNotification(RemoteDamageNotification remoteDamageNotification) { |
| 152 | if (auto sourceEntity = m_world->entity(remoteDamageNotification.sourceEntityId)) { |
no test coverage detected