本文整理汇总了C++中TMap::FindAndRemoveChecked方法的典型用法代码示例。如果您正苦于以下问题:C++ TMap::FindAndRemoveChecked方法的具体用法?C++ TMap::FindAndRemoveChecked怎么用?C++ TMap::FindAndRemoveChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMap
的用法示例。
在下文中一共展示了TMap::FindAndRemoveChecked方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveEffect
void FGAGameEffectContainer::RemoveEffect(FGAGameEffectHandle& HandleIn)
{
EGAEffectAggregation aggregatiopn = HandleIn.GetEffectRef().GameEffect->EffectAggregation;
UObject* Instigator = HandleIn.GetContextRef().Instigator.Get();
TSharedPtr<FGAGameEffect> effect = ActiveEffects.FindAndRemoveChecked(HandleIn);
if (effect.IsValid())
{
switch (aggregatiopn)
{
case EGAEffectAggregation::AggregateByInstigator:
{
TMap<FGAGameEffectHandle, TSharedPtr<FGAGameEffect>>* effects = InstigatorEffects.Find(Instigator);
TMap<FName, TSet<FGAGameEffectHandle>>* EffectByClass = InstigatorEffectHandles.Find(Instigator);
if (EffectByClass)
{
//Probabaly need another path for removing just single effect from stack.
EffectByClass->Remove(HandleIn.GetEffectSpec()->GetFName());
}
if (effects)
{
effects->FindAndRemoveChecked(HandleIn);
if (effects->Num() == 0)
{
InstigatorEffects.Remove(Instigator);
}
}
break;
}
case EGAEffectAggregation::AggregateByTarget:
{
//TargetEffects.FindAndRemoveChecked(HandleIn);
TSet<FGAGameEffectHandle>* Handles = TargetEffectByType.Find(HandleIn.GetEffectSpec()->GetFName());
//check aggregation type to know which effect to remove exactly ?
TargetEffectByType.Remove(HandleIn.GetEffectSpec()->GetFName());
break;
}
}
for (FGAGameEffectModifier& Modifier : effect->GameEffect->Modifiers)
{
if (Modifier.Attribute.IsValid())
{
FGAAttributeBase* Attribute = OwningComp->GetAttribute(Modifier.Attribute);
if (Attribute)
{
Attribute->RemoveBonus(HandleIn);
}
}
}
UE_LOG(GameAttributesEffects, Log, TEXT("FGAGameEffectContainer:: Removing Effect"))
effect.Reset();
}
}
示例2: RemoveEffect
void FGAGameEffectContainer::RemoveEffect(FGAGameEffectHandle& HandleIn)
{
EGAEffectAggregation aggregatiopn = HandleIn.GetEffectRef().GameEffect->EffectAggregation;
UObject* Instigator = HandleIn.GetContextRef().Instigator.Get();
TSharedPtr<FGAGameEffect> effect = ActiveEffects.FindAndRemoveChecked(HandleIn);
if (effect.IsValid())
{
switch (aggregatiopn)
{
case EGAEffectAggregation::AggregateByInstigator:
{
TMap<FGAGameEffectHandle, TSharedPtr<FGAGameEffect>>* effects = InstigatorEffects.Find(Instigator);
TMap<UClass*, FGAGameEffectHandle>* EffectByClass = InstigatorEffectHandles.Find(Instigator);
if (EffectByClass)
{
EffectByClass->Remove(HandleIn.GetEffectSpec()->StaticClass());
}
if (effects)
{
effects->FindAndRemoveChecked(HandleIn);
if (effects->Num() == 0)
{
InstigatorEffects.Remove(Instigator);
}
}
break;
}
case EGAEffectAggregation::AggregateByTarget:
{
TargetEffects.FindAndRemoveChecked(HandleIn);
break;
}
}
for (FGAGameEffectModifier& Modifier : effect->GameEffect->Modifiers)
{
if (Modifier.Attribute.IsValid())
{
FGAAttributeBase* Attribute = OwningComp->GetAttribute(Modifier.Attribute);
if (Attribute)
{
Attribute->RemoveBonus(HandleIn);
}
}
}
UE_LOG(GameAttributesEffects, Log, TEXT("FGAGameEffectContainer:: Removing Effect"))
effect.Reset();
}
}
示例3: DoDeviceDisconnect
void FIOSDeviceHelper::DoDeviceDisconnect(void* deviceHandle)
{
IOSDevice* device = NULL;
for (auto DeviceIterator = ConnectedDevices.CreateIterator(); DeviceIterator; ++DeviceIterator)
{
if (DeviceIterator.Key()->Handle() == deviceHandle)
{
device = DeviceIterator.Key();
break;
}
}
if (device != NULL)
{
// extract the device id from the connected list¯
FIOSLaunchDaemonPong Event = ConnectedDevices.FindAndRemoveChecked(device);
// fire the event
FIOSDeviceHelper::OnDeviceDisconnected().Broadcast(Event);
// delete the device
delete device;
}
}