我有以下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当我试图阅读不同的“系统”时,yaml-cpp说:
抛出'YAML::ParserException‘的实例后调用的终止():yaml-cpp:第32行中的错误,第25列:非法映射值
第32行第25列就在"y:“之后。我不知道我做错了什么。谢谢你的帮助!
发布于 2015-09-11 04:18:54
第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: 50https://stackoverflow.com/questions/32511710
复制相似问题