Newer
Older
DungeonShooting / DungeonShooting_Godot / src / framework / activity / ActivityId.cs
@小李xl 小李xl on 20 Aug 2023 2 KB 创建房间标记, 开发中
  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. public static string GetTypeName(ActivityType activityType)
  78. {
  79. switch (activityType)
  80. {
  81. case ActivityType.None:
  82. return "";
  83. case ActivityType.Test:
  84. return "测试";
  85. case ActivityType.Role:
  86. case ActivityType.Player:
  87. return "角色";
  88. case ActivityType.Enemy:
  89. return "敌人";
  90. case ActivityType.Weapon:
  91. return "武器";
  92. case ActivityType.Bullet:
  93. return "子弹";
  94. case ActivityType.Shell:
  95. return "弹壳";
  96. case ActivityType.Effect:
  97. return "特效";
  98. case ActivityType.Prop:
  99. return "道具";
  100. case ActivityType.Other:
  101. return "其他";
  102. }
  103.  
  104. return "";
  105. }
  106. }