Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / manager / ActivityIdPrefix.cs
  1.  
  2. //Activity注册类id前缀
  3. public static class ActivityIdPrefix
  4. {
  5. public enum ActivityPrefixType
  6. {
  7. NonePrefix,
  8. Test,
  9. Role,
  10. Enemy,
  11. Weapon,
  12. Bullet,
  13. Shell,
  14. Other,
  15. }
  16. /// <summary>
  17. /// 测试单位
  18. /// </summary>
  19. public const string Test = "test";
  20. /// <summary>
  21. /// 角色
  22. /// </summary>
  23. public const string Role = "role";
  24. /// <summary>
  25. /// 敌人
  26. /// </summary>
  27. public const string Enemy = "enemy";
  28. /// <summary>
  29. /// 武器
  30. /// </summary>
  31. public const string Weapon = "weapon";
  32. /// <summary>
  33. /// 子弹
  34. /// </summary>
  35. public const string Bullet = "bullet";
  36. /// <summary>
  37. /// 弹壳
  38. /// </summary>
  39. public const string Shell = "shell";
  40. /// <summary>
  41. /// 其他类型
  42. /// </summary>
  43. public const string Other = "other";
  44.  
  45. /// <summary>
  46. /// 根据 ActivityPrefixType 中的枚举类型获取类型名称的字符串
  47. /// </summary>
  48. public static string GetNameByPrefixType(ActivityPrefixType prefixType)
  49. {
  50. switch (prefixType)
  51. {
  52. case ActivityPrefixType.NonePrefix:
  53. return "";
  54. case ActivityPrefixType.Test:
  55. return Test;
  56. case ActivityPrefixType.Role:
  57. return Role;
  58. case ActivityPrefixType.Enemy:
  59. return Enemy;
  60. case ActivityPrefixType.Weapon:
  61. return Weapon;
  62. case ActivityPrefixType.Bullet:
  63. return Bullet;
  64. case ActivityPrefixType.Shell:
  65. return Shell;
  66. case ActivityPrefixType.Other:
  67. return Other;
  68. }
  69.  
  70. return "";
  71. }
  72. }