DRWeapon.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 Jiang Yin. All rights reserved.
  4. // Homepage: https://gameframework.cn/
  5. // Feedback: mailto:ellan@gameframework.cn
  6. //------------------------------------------------------------
  7. // 此文件由工具自动生成,请勿直接修改。
  8. // 生成时间:2022-01-25 20:36:36.472
  9. //------------------------------------------------------------
  10. using GameFramework;
  11. using System;
  12. using System.Collections.Generic;
  13. using System.IO;
  14. using System.Text;
  15. using UnityEngine;
  16. using UnityGameFramework.Runtime;
  17. namespace MetaClient
  18. {
  19. /// <summary>
  20. /// 武器表。
  21. /// </summary>
  22. public class DRWeapon : DataRowBase
  23. {
  24. private int m_Id = 0;
  25. /// <summary>
  26. /// 获取武器编号。
  27. /// </summary>
  28. public override int Id
  29. {
  30. get
  31. {
  32. return m_Id;
  33. }
  34. }
  35. /// <summary>
  36. /// 获取攻击力。
  37. /// </summary>
  38. public int Attack
  39. {
  40. get;
  41. private set;
  42. }
  43. /// <summary>
  44. /// 获取攻击间隔。
  45. /// </summary>
  46. public float AttackInterval
  47. {
  48. get;
  49. private set;
  50. }
  51. /// <summary>
  52. /// 获取子弹编号。
  53. /// </summary>
  54. public int BulletId
  55. {
  56. get;
  57. private set;
  58. }
  59. /// <summary>
  60. /// 获取子弹速度。
  61. /// </summary>
  62. public float BulletSpeed
  63. {
  64. get;
  65. private set;
  66. }
  67. /// <summary>
  68. /// 获取子弹声音编号。
  69. /// </summary>
  70. public int BulletSoundId
  71. {
  72. get;
  73. private set;
  74. }
  75. public override bool ParseDataRow(string dataRowString, object userData)
  76. {
  77. string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
  78. for (int i = 0; i < columnStrings.Length; i++)
  79. {
  80. columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
  81. }
  82. int index = 0;
  83. index++;
  84. m_Id = int.Parse(columnStrings[index++]);
  85. index++;
  86. Attack = int.Parse(columnStrings[index++]);
  87. AttackInterval = float.Parse(columnStrings[index++]);
  88. BulletId = int.Parse(columnStrings[index++]);
  89. BulletSpeed = float.Parse(columnStrings[index++]);
  90. BulletSoundId = int.Parse(columnStrings[index++]);
  91. GeneratePropertyArray();
  92. return true;
  93. }
  94. public override bool ParseDataRow(byte[] dataRowBytes, int startIndex, int length, object userData)
  95. {
  96. using (MemoryStream memoryStream = new MemoryStream(dataRowBytes, startIndex, length, false))
  97. {
  98. using (BinaryReader binaryReader = new BinaryReader(memoryStream, Encoding.UTF8))
  99. {
  100. m_Id = binaryReader.Read7BitEncodedInt32();
  101. Attack = binaryReader.Read7BitEncodedInt32();
  102. AttackInterval = binaryReader.ReadSingle();
  103. BulletId = binaryReader.Read7BitEncodedInt32();
  104. BulletSpeed = binaryReader.ReadSingle();
  105. BulletSoundId = binaryReader.Read7BitEncodedInt32();
  106. }
  107. }
  108. GeneratePropertyArray();
  109. return true;
  110. }
  111. private void GeneratePropertyArray()
  112. {
  113. }
  114. }
  115. }