ShowEntityUpdateEventArgs.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 loyalsoft. All rights reserved.
  4. // Homepage: http://www.game7000.com/
  5. // Feedback: http://www.game7000.com/
  6. //------------------------------------------------------------
  7. namespace GameFramework.Entity
  8. {
  9. /// <summary>
  10. /// 显示实体更新事件。
  11. /// </summary>
  12. public sealed class ShowEntityUpdateEventArgs : GameFrameworkEventArgs
  13. {
  14. /// <summary>
  15. /// 初始化显示实体更新事件的新实例。
  16. /// </summary>
  17. public ShowEntityUpdateEventArgs()
  18. {
  19. EntityId = 0;
  20. EntityAssetName = null;
  21. EntityGroupName = null;
  22. Progress = 0f;
  23. UserData = null;
  24. }
  25. /// <summary>
  26. /// 获取实体编号。
  27. /// </summary>
  28. public int EntityId
  29. {
  30. get;
  31. private set;
  32. }
  33. /// <summary>
  34. /// 获取实体资源名称。
  35. /// </summary>
  36. public string EntityAssetName
  37. {
  38. get;
  39. private set;
  40. }
  41. /// <summary>
  42. /// 获取实体组名称。
  43. /// </summary>
  44. public string EntityGroupName
  45. {
  46. get;
  47. private set;
  48. }
  49. /// <summary>
  50. /// 获取显示实体进度。
  51. /// </summary>
  52. public float Progress
  53. {
  54. get;
  55. private set;
  56. }
  57. /// <summary>
  58. /// 获取用户自定义数据。
  59. /// </summary>
  60. public object UserData
  61. {
  62. get;
  63. private set;
  64. }
  65. /// <summary>
  66. /// 创建显示实体更新事件。
  67. /// </summary>
  68. /// <param name="entityId">实体编号。</param>
  69. /// <param name="entityAssetName">实体资源名称。</param>
  70. /// <param name="entityGroupName">实体组名称。</param>
  71. /// <param name="progress">显示实体进度。</param>
  72. /// <param name="userData">用户自定义数据。</param>
  73. /// <returns>创建的显示实体更新事件。</returns>
  74. public static ShowEntityUpdateEventArgs Create(int entityId, string entityAssetName, string entityGroupName, float progress, object userData)
  75. {
  76. ShowEntityUpdateEventArgs showEntityUpdateEventArgs = ReferencePool.Acquire<ShowEntityUpdateEventArgs>();
  77. showEntityUpdateEventArgs.EntityId = entityId;
  78. showEntityUpdateEventArgs.EntityAssetName = entityAssetName;
  79. showEntityUpdateEventArgs.EntityGroupName = entityGroupName;
  80. showEntityUpdateEventArgs.Progress = progress;
  81. showEntityUpdateEventArgs.UserData = userData;
  82. return showEntityUpdateEventArgs;
  83. }
  84. /// <summary>
  85. /// 清理显示实体更新事件。
  86. /// </summary>
  87. public override void Clear()
  88. {
  89. EntityId = 0;
  90. EntityAssetName = null;
  91. EntityGroupName = null;
  92. Progress = 0f;
  93. UserData = null;
  94. }
  95. }
  96. }