| 162 | } |
| 163 | |
| 164 | bool PersistentObject::notifyRemoveAsked() |
| 165 | { |
| 166 | mIsWorking = false; |
| 167 | // If at least 1 player has vision on this PersistentObject, we cannot remove it |
| 168 | // from gamemap. |
| 169 | // We check if there is at least 1 seat that have been notified previously and |
| 170 | // lost vision |
| 171 | for(Seat* seat : mSeatsAlreadyNotifiedOnce) |
| 172 | { |
| 173 | auto it = std::find(mSeatsWithVisionNotified.begin(), mSeatsWithVisionNotified.end(), seat); |
| 174 | if(it != mSeatsWithVisionNotified.end()) |
| 175 | continue; |
| 176 | |
| 177 | // There is at least 1 seat that have seen the PersistentObject but not currently |
| 178 | // have vision on it. We cannot remove it |
| 179 | return false; |
| 180 | } |
| 181 | |
| 182 | return true; |
| 183 | } |
no outgoing calls
no test coverage detected