我正在编写一个基于 C++ 的多人游戏。
我需要一种灵活的文件格式来存储有关游戏角色的信息。
游戏角色通常不会共享相同的属性,或者使用 basew
例如:
一种允许我执行以下操作的格式:
#include "standardsettings.config"
//include other files which this file
//then changes
FastSpaceship:
Speed: 10 //pixels/sec
Rotation: 5 //deg/sec
MotherShip : FastSpaceship //inherits all the settings of the Spaceship ship
ShieldRecharge: 4
WeaponA [ power:10,
range:20,
style:fireball]
SlowMotherShip : MotherShip //inherits all the settings of the monther ship
Speed: 4 // override speed
我一直在寻找一种预先存在的格式来完成这一切,或者类似,但没有运气。除非必须,否则我不想重新发明轮子,所以我想知道是否有人知道任何支持这些功能的良好配置文件格式