文章目录
声明
- 声明
- 添加
- 修改
- 删除
- 查找
- 遍历
TMap PlayerProps;
添加
PlayerProps.Add("HP",100.0);
PlayerProps.Add("Strength",100.0);
PlayerProps.Add("IQ",500.0);
修改
PlayerProps["IQ"] = 600.0;
删除
PlayerProps.Remove("Strength");
查找
if(PlayerProps.Contains("IQ"))
{
UE_LOG(LogTemp,Warning,TEXT("Contains IQ Property %f"), PlayerProps["IQ"]);
}
遍历
for (auto PP: PlayerProps)
{
UE_LOG(LogTemp,Warning,TEXT("Contains IQ Property: Key %s"), *PP.Key);
UE_LOG(LogTemp,Warning,TEXT("Contains IQ Property: Value %f"), PP.Value);
}