在yaml-cpp中读取地图
Reading maps in yaml-cpp
我有以下yaml文件:
Pantalla:
ancho: 640
alto: 480
Configuracion:
vel_personaje: 3
merge_scroll: 30
Tipos:
- nombre: arbol
imagen: img/tree
ancho_base: 2
alto_base: 2
pixel_ref_x: 30
pixel_ref_y: 40
fps: 10
delay: 5
- nombre: casa
imagen: img/house
- nombre: auto
imagen: img/car
ancho_base: 5
alto_base: 5
Escenario:
- nombre: principal
size_x: 100
size_y: 100
entidades:
- {x: 10, y: 15, tipo: tierra}
- {x: 15, y: 20, tipo: tierra}
- {x: 10, y: 15, tipo: agua}
- {x: 30, y: 55, tipo: castillo}
protagonista:
- tipo: principal
x: 50
y: 50
当我试图读取不同的"entidades"时,yaml-cpp显示如下:
抛出'YAML::ParserException'实例后调用终止What (): yaml-cpp:第32行第25列错误:非法映射值
第32行第25列正好在"y: "后面。我不知道我做错了什么。谢谢你的帮助!
第28行破折号为u00ad
,即"软连字符"。我觉得应该是这样的:
Escenario:
nombre: principal
size_x: 100
size_y: 100
entidades:
- {x: 10, y: 15, tipo: tierra}
- {x: 15, y: 20, tipo: tierra}
- {x: 10, y: 15, tipo: agua}
- {x: 30, y: 55, tipo: castillo}
protagonista:
- tipo: principal
x: 50
y: 50
y: 50
相关文章:
- 理解boost::asio-async_read在无需读取内容时的行为
- 使用新行和不使用新行读取文件
- 读取文件并输入到矢量中
- 为什么不;名字在地图上是按顺序排列的吗
- 用c++从输入文件中读取另一行
- 读取文件的最后一行并输入到链接列表时出错
- 在进程中对同一管道进行读取和写入时C++管道出现问题
- C++将文件内容读取到地图中
- C++,如何从文件中读取数据并插入容器:地图
- 从文件中读取数据并插入到地图C++中
- 如何从文件中读取输入并在C++中配对到地图中
- 将集合插入/读取到地图中
- 在 const 函数中从地图中未经选中读取
- 使用 valgrind 的地图中的读取大小错误无效
- 如何在使用 Boost C++ 编写的 php Web 应用程序中读取地图(在共享区域中)
- 如果我在键不存在的情况下读取地图的值,会发生什么情况?
- 房间地图游戏程序从文件读取
- 在yaml-cpp中读取地图
- 插入和读取值从3D地图
- std::在单独的线程中插入时读取地图