Struct.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. namespace ET.Server
  2. {
  3. /// <summary>
  4. /// 游戏服数据结构
  5. /// </summary>
  6. public class Struct
  7. {
  8. /// <summary>
  9. /// 场景数据
  10. /// </summary>
  11. public class AreaData
  12. {
  13. public MapConfig prop { get; set; }
  14. public int areaId { get; set; }
  15. public long instanceId { get; set; }
  16. public float targetX { get; set; }
  17. public float targetY { get; set; }
  18. public int logicServerId { get; set; }
  19. public ENTER_TYPE enterType = ENTER_TYPE.NONE;
  20. public AreaData(int areaId) {
  21. this.prop = MapConfigCategory.Instance.Get(areaId);
  22. this.areaId = areaId;
  23. }
  24. public AreaData(MapConfig prop) {
  25. this.areaId = prop.Id;
  26. this.prop = prop;
  27. }
  28. public AreaData(int areaId, long instanceId) {
  29. this.prop = MapConfigCategory.Instance.Get(areaId);
  30. this.areaId = areaId;
  31. this.instanceId = instanceId;
  32. }
  33. public AreaData(int areaId, float targetX, float targetY) {
  34. this.prop = MapConfigCategory.Instance.Get(areaId);
  35. this.areaId = areaId;
  36. this.targetX = targetX;
  37. this.targetY = targetY;
  38. }
  39. public AreaData(int areaId, float targetX, float targetY, ENTER_TYPE enterType) {
  40. this.prop = MapConfigCategory.Instance.Get(areaId);
  41. this.areaId = areaId;
  42. this.targetX = targetX;
  43. this.targetY = targetY;
  44. this.enterType = enterType;
  45. }
  46. public AreaData(int areaId, long instanceId, ENTER_TYPE enterType) {
  47. this.prop = MapConfigCategory.Instance.Get(areaId);
  48. this.areaId = areaId;
  49. this.instanceId = instanceId;
  50. this.enterType = enterType;
  51. }
  52. }
  53. /// <summary>
  54. /// 怪物单位数据
  55. /// </summary>
  56. public class MonsterUnit
  57. {
  58. /** 怪物名字 **/
  59. public string name{ get; set; }
  60. /** 怪物模板ID **/
  61. public int id{ get; set; }
  62. /** 阵营信息 **/
  63. public int force{ get; set; }
  64. /** 刷新点名字,为空才去读x, y **/
  65. public string flag{ get; set; }
  66. public bool autoGuard{ get; set; }
  67. /** 同一个Area是否只能同时有一个怪存在 **/
  68. public bool unique = false;
  69. /** 坐标x **/
  70. public int x{ get; set; }
  71. /** 坐标y **/
  72. public int y{ get; set; }
  73. /** 是否是任务 共享怪 **/
  74. public int shareType{ get; set; }
  75. /** 动态怪物等级,战斗服根据此计算怪物的动态数值 **/
  76. public int level{ get; set; }
  77. /** 初始朝向 **/
  78. public float birthDirection{ get; set; }
  79. /** 服务器标记字段,怪物死亡时,会回传回来 **/
  80. public int gsFlag{ get; set; }
  81. /** 指定血量 **/
  82. public int hp{ get; set; }
  83. public int maxHP{ get; set; }
  84. /** 指定追击玩家id(必须是无限追击怪才会联动生效) **/
  85. public string attackPlayer{ get; set; }
  86. /** 创建护卫怪,主人ObjectId(主人脱战或者死亡消失) **/
  87. public int masterID{ get; set; }
  88. public MonsterUnit() {
  89. }
  90. public MonsterUnit(int monsterID, int force, bool unique, int x, int y) {
  91. this.id = monsterID;
  92. this.force = force;
  93. this.unique = unique;
  94. this.x = x;
  95. this.y = y;
  96. }
  97. public MonsterUnit(int monsterID, string refrushEvent, bool unique, int force) {
  98. this.id = monsterID;
  99. this.force = force;
  100. this.unique = unique;
  101. this.flag = refrushEvent;
  102. }
  103. public MonsterUnit(int monsterID, string refrushEvent, bool unique, int force, float birthDirection) {
  104. this.id = monsterID;
  105. this.force = force;
  106. this.unique = unique;
  107. this.flag = refrushEvent;
  108. this.birthDirection = birthDirection;
  109. }
  110. }
  111. }
  112. }