您当前的位置: 首页 >  容器

开发游戏的老王

暂无认证

  • 4浏览

    0关注

    803博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

虚幻引擎图文笔记:容器(二)字典容器TMap

开发游戏的老王 发布时间:2020-06-18 15:04:30 ,浏览量:4

文章目录
      • 声明
      • 添加
      • 修改
      • 删除
      • 查找
      • 遍历

声明
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);
		
	}
关注
打赏
1656935939
查看更多评论
立即登录/注册

微信扫码登录

0.0386s