Newer
Older
DungeonShooting / DungeonShooting_Godot / src / framework / activity / ActivityId.cs
  1.  
  2. /// <summary>
  3. /// Activity注册类id前缀
  4. /// </summary>
  5. public static class ActivityId
  6. {
  7. /// <summary>
  8. /// 测试单位
  9. /// </summary>
  10. public const string Test = "test";
  11. /// <summary>
  12. /// 角色
  13. /// </summary>
  14. public const string Role = "role";
  15. /// <summary>
  16. /// 敌人
  17. /// </summary>
  18. public const string Enemy = "enemy";
  19. /// <summary>
  20. /// 武器
  21. /// </summary>
  22. public const string Weapon = "weapon";
  23. /// <summary>
  24. /// 子弹
  25. /// </summary>
  26. public const string Bullet = "bullet";
  27. /// <summary>
  28. /// 弹壳
  29. /// </summary>
  30. public const string Shell = "shell";
  31. /// <summary>
  32. /// 特效
  33. /// </summary>
  34. public const string Effect = "effect";
  35. /// <summary>
  36. /// 道具
  37. /// </summary>
  38. public const string Prop = "prop";
  39. /// <summary>
  40. /// 其他类型
  41. /// </summary>
  42. public const string Other = "other";
  43.  
  44. /// <summary>
  45. /// 根据 ActivityType 中的枚举类型获取类型名称的字符串
  46. /// </summary>
  47. public static string GetIdPrefix(ActivityType activityType)
  48. {
  49. switch (activityType)
  50. {
  51. case ActivityType.None:
  52. return "";
  53. case ActivityType.Test:
  54. return Test;
  55. case ActivityType.Role:
  56. case ActivityType.Player:
  57. return Role;
  58. case ActivityType.Enemy:
  59. return Enemy;
  60. case ActivityType.Weapon:
  61. return Weapon;
  62. case ActivityType.Bullet:
  63. return Bullet;
  64. case ActivityType.Shell:
  65. return Shell;
  66. case ActivityType.Effect:
  67. return Effect;
  68. case ActivityType.Prop:
  69. return Prop;
  70. case ActivityType.Other:
  71. return Other;
  72. }
  73.  
  74. return "";
  75. }
  76.  
  77. /// <summary>
  78. /// 根据 ActivityType 中的枚举类型获取类型名称的字符串
  79. /// </summary>
  80. public static string GetTypeName(ActivityType activityType)
  81. {
  82. switch (activityType)
  83. {
  84. case ActivityType.None:
  85. return "";
  86. case ActivityType.Test:
  87. return "测试";
  88. case ActivityType.Role:
  89. case ActivityType.Player:
  90. return "角色";
  91. case ActivityType.Enemy:
  92. return "敌人";
  93. case ActivityType.Weapon:
  94. return "武器";
  95. case ActivityType.Bullet:
  96. return "子弹";
  97. case ActivityType.Shell:
  98. return "弹壳";
  99. case ActivityType.Effect:
  100. return "特效";
  101. case ActivityType.Prop:
  102. return "道具";
  103. case ActivityType.Other:
  104. return "其他";
  105. }
  106.  
  107. return "";
  108. }
  109. }