MapTable.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Generate By EToy
  2. // Don't Edit It!!
  3. using XGame.Framework.Database;
  4. using XGame.Framework.Serialization;
  5. namespace XGame.Database
  6. {
  7. /// <summary> Map </summary>
  8. public sealed class MapTable : ITable
  9. {
  10. long ITable.Key => Id;
  11. /// <summary> 主键 </summary>
  12. public int Id { get; private set; }
  13. /// <summary> 地图名字 </summary>
  14. public string Name { get; private set; }
  15. /// <summary> 资源名字 </summary>
  16. public string AssetName { get; private set; } // c
  17. /// <summary> 玩家出生点 </summary>
  18. public Vec3 PlayerBirth { get; private set; }
  19. /// <summary> 战斗地点,使用哪个由Chapter.part决定 </summary>
  20. public Vec3[] BattlePositions { get; private set; }
  21. /// <summary> 怪物出生点,一个取中间,2个左右对称偏移 </summary>
  22. public Vec3[] MonsterPositions { get; private set; }
  23. void ISerializable.Deserialize(IReader reader)
  24. {
  25. Id = reader.ReadInt();
  26. Name = reader.ReadString();
  27. AssetName = reader.ReadString();
  28. PlayerBirth = reader.ReadSerializable<Vec3>();
  29. BattlePositions = reader.ReadEnumerable<Vec3[]>();
  30. MonsterPositions = reader.ReadEnumerable<Vec3[]>();
  31. }
  32. void ISerializable.Serialize(IWriter writer)
  33. {
  34. writer.Write(Id);
  35. writer.Write(Name);
  36. writer.Write(AssetName);
  37. writer.Write(PlayerBirth);
  38. writer.Write(BattlePositions);
  39. writer.Write(MonsterPositions);
  40. }
  41. }
  42. }