我很擅长使用XML来定义C#中实际管理的对象,但必须有更好的方法.
我的游戏数据库的数据是由几个XML文件构成的,这是一个比较精细的文件,因为我用它来测试所有地方
<GameData xmlns:NSW="Napivo.StarWars">
<!-- Ships -->
<!-- AITroopAccelerator -->
<Asset Type="ShipDescription">
<Name>AITroopAccelerator</Name>
<Asset Type="SpriteAnimation">
<Name>\Ships\AITroopAccelerator\1.png</Name>
<Name>\Ships\AITroopAccelerator\2.png</Name>
<Name>\Ships\AITroopAccelerator\3.png</Name>
<Name>\Ships\AITroopAccelerator\2.png</Name>
<Speed>150</Speed>
</Asset>
<Asset Type="WeaponGroup" Num ="0">
<Weapon Name ="Missile" Angle ="0" X ="0" Y ="0"> </Weapon>
<Asset Type="WeaponGroup" Num ="1">
<Weapon Name ="NegativeEnergyFlare" Angle ="180" X ="0" Y ="0"> </Weapon>
</Asset>
<Weapon Name ="Lightning" Angle ="0" X ="0" Y ="0"> </Weapon>
</Asset>
<Asset Type="WeaponGroup" Num ="2">
<Weapon Name ="FastLazer" Angle ="-10" X ="0" Y ="0"> </Weapon>
<Weapon Name ="FastLazer" Angle ="+10" …Run Code Online (Sandbox Code Playgroud)