BaseSpecializationManager.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using System;
  2. using System.Collections.Generic;
  3. namespace I2.Loc
  4. {
  5. public class BaseSpecializationManager
  6. {
  7. public virtual void InitializeSpecializations()
  8. {
  9. this.mSpecializations = new string[]
  10. {
  11. "Any",
  12. "PC",
  13. "Touch",
  14. "Controller",
  15. "VR",
  16. "XBox",
  17. "PS4",
  18. "OculusVR",
  19. "ViveVR",
  20. "GearVR",
  21. "Android",
  22. "IOS"
  23. };
  24. this.mSpecializationsFallbacks = new Dictionary<string, string>
  25. {
  26. {
  27. "XBox",
  28. "Controller"
  29. },
  30. {
  31. "PS4",
  32. "Controller"
  33. },
  34. {
  35. "OculusVR",
  36. "VR"
  37. },
  38. {
  39. "ViveVR",
  40. "VR"
  41. },
  42. {
  43. "GearVR",
  44. "VR"
  45. },
  46. {
  47. "Android",
  48. "Touch"
  49. },
  50. {
  51. "IOS",
  52. "Touch"
  53. }
  54. };
  55. }
  56. public virtual string GetCurrentSpecialization()
  57. {
  58. if (this.mSpecializations == null)
  59. {
  60. this.InitializeSpecializations();
  61. }
  62. return "PC";
  63. }
  64. public virtual string GetFallbackSpecialization(string specialization)
  65. {
  66. if (this.mSpecializationsFallbacks == null)
  67. {
  68. this.InitializeSpecializations();
  69. }
  70. string result;
  71. if (this.mSpecializationsFallbacks.TryGetValue(specialization, out result))
  72. {
  73. return result;
  74. }
  75. return "Any";
  76. }
  77. public string[] mSpecializations;
  78. public Dictionary<string, string> mSpecializationsFallbacks;
  79. }
  80. }