104 "Trying to cast to a FeatureList not included in the "
105 "optional FeatureLists of this map.");
112 auto castIt = this->castCache.find(_entity);
113 if (castIt != this->castCache.end())
115 auto castEntity = std::get<ToEntityPtr>(castIt->second.entities);
116 if (
nullptr != castEntity)
123 if (std::get<FailedCast<ToFeatureList>>(castIt->second.failed).value)
129 auto reqEntity = this->Get(_entity);
130 if (
nullptr == reqEntity)
139 auto &cached = this->castCache[_entity];
142 std::get<ToEntityPtr>(cached.entities) = castEntity;
146 std::get<FailedCast<ToFeatureList>>(cached.failed).value =
true;
269 auto it = this->entityMap.find(_entity);
270 if (it != this->entityMap.end())
272 this->reverseMap.erase(it->second);
273 this->physEntityById.erase(it->second->EntityID());
274 this->entityByPhysId.erase(it->second->EntityID());
275 this->castCache.erase(_entity);
276 this->entityMap.erase(it);
287 auto it = this->reverseMap.find(_physicsEntity);
288 if (it != this->reverseMap.end())
290 this->entityMap.erase(it->second);
291 this->physEntityById.erase(it->first->EntityID());
292 this->entityByPhysId.erase(it->first->EntityID());
293 this->castCache.erase(it->second);
294 this->reverseMap.erase(it);