| 234 | } |
| 235 | |
| 236 | int AFCMapModule::CreateMapInstance(const int map_id) |
| 237 | { |
| 238 | auto pMapInfo = map_infos_.find_value(map_id); |
| 239 | if (pMapInfo == nullptr) |
| 240 | { |
| 241 | return -1; |
| 242 | } |
| 243 | |
| 244 | int new_inst_id = pMapInfo->CreateInstanceID(); |
| 245 | |
| 246 | if (pMapInfo->ExistInstance(new_inst_id)) |
| 247 | { |
| 248 | return -1; |
| 249 | } |
| 250 | |
| 251 | auto pMapInstance = std::make_shared<AFMapInstance>(new_inst_id); |
| 252 | if (pMapInstance == nullptr) |
| 253 | { |
| 254 | return -1; |
| 255 | } |
| 256 | |
| 257 | pMapInfo->AddInstance(new_inst_id, pMapInstance); |
| 258 | return new_inst_id; |
| 259 | } |
| 260 | |
| 261 | bool AFCMapModule::ReleaseMapInstance(const int map_id, const int inst_id) |
| 262 | { |
nothing calls this directly
no test coverage detected