| 259 | } |
| 260 | |
| 261 | bool AFCMapModule::ReleaseMapInstance(const int map_id, const int inst_id) |
| 262 | { |
| 263 | auto pMapInfo = map_infos_.find_value(map_id); |
| 264 | if (nullptr == pMapInfo) |
| 265 | { |
| 266 | return false; |
| 267 | } |
| 268 | |
| 269 | if (!pMapInfo->ExistInstance(inst_id)) |
| 270 | { |
| 271 | return false; |
| 272 | } |
| 273 | |
| 274 | AFCDataList listObject; |
| 275 | |
| 276 | if (GetInstEntityList(map_id, inst_id, listObject)) |
| 277 | { |
| 278 | for (size_t i = 0; i < listObject.GetCount(); ++i) |
| 279 | { |
| 280 | AFGUID ident = listObject.Int64(i); |
| 281 | |
| 282 | if (!m_pKernelModule->DestroyEntity(ident)) |
| 283 | { |
| 284 | ARK_LOG_ERROR("Destory entity failed, id = {}, please check", ident); |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | pMapInfo->RemoveInstance(inst_id); |
| 290 | |
| 291 | return true; |
| 292 | } |
| 293 | |
| 294 | bool AFCMapModule::ExitMapInstance(const int map_id, const int inst_id) |
| 295 | { |
nothing calls this directly
no test coverage detected