A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
2.9KB

  1. using DataLoader;
  2. using HarmonyLib;
  3. using RobocraftX;
  4. using RobocraftX.CR.MainGame;
  5. using RobocraftX.GUI;
  6. using RobocraftX.Multiplayer;
  7. using Svelto.Context;
  8. using Svelto.DataStructures;
  9. using Svelto.ECS;
  10. using UnityEngine;
  11. using Unity.Entities;
  12. using Unity.Physics.Systems;
  13. namespace TechbloxModdingAPI.Utility
  14. {
  15. /// <summary>
  16. /// Public access to the private variables in RobocraftX.FullGameCompositionRoot
  17. /// </summary>
  18. public static class FullGameFields
  19. {
  20. public static FullGameCompositionRoot Instance
  21. {
  22. private set;
  23. get;
  24. } = null;
  25. public static MultiplayerInitParameters _multiplayerParams
  26. {
  27. get
  28. {
  29. return (MultiplayerInitParameters)fgcr?.Field("_multiplayerParams").GetValue();
  30. }
  31. }
  32. public static EnginesRoot _frontEndEnginesRoot
  33. {
  34. get
  35. {
  36. return (EnginesRoot)fgcr?.Field("_frontEndEnginesRoot").GetValue();
  37. }
  38. }
  39. public static EnginesRoot _mainGameEnginesRoot
  40. {
  41. get
  42. {
  43. return (EnginesRoot)fgcr?.Field("_mainGameEnginesRoot").GetValue();
  44. }
  45. }
  46. public static World _physicsWorld
  47. {
  48. get
  49. {
  50. return (World)fgcr?.Field("_physicsWorld").GetValue();
  51. }
  52. }
  53. public static World _renderingWorld
  54. {
  55. get
  56. {
  57. return (World)fgcr?.Field("_renderingWorld").GetValue();
  58. }
  59. }
  60. public static BuildPhysicsWorld _physicsWorldSystem
  61. {
  62. get
  63. {
  64. return (BuildPhysicsWorld)fgcr?.Field("_physicsWorldSystem").GetValue();
  65. }
  66. }
  67. public static UnityContext<FullGameCompositionRoot> _contextHolder
  68. {
  69. get
  70. {
  71. return (UnityContext<FullGameCompositionRoot>)fgcr?.Field("_contextHolder").GetValue();
  72. }
  73. }
  74. public static GameObject _frontEndGo
  75. {
  76. get
  77. {
  78. return (GameObject)fgcr?.Field("_frontEndGo").GetValue();
  79. }
  80. }
  81. public static GameObject _mainGameGo
  82. {
  83. get
  84. {
  85. return (GameObject)fgcr?.Field("_mainGameGo").GetValue();
  86. }
  87. }
  88. /*public static UnityEntitySubmissionScheduler _frontEndSubmissionScheduler
  89. {
  90. get
  91. {
  92. return (UnityEntitySubmissionScheduler)fgcr?.Field("_frontEndSubmissionScheduler").GetValue();
  93. }
  94. }*/
  95. public static LoadingScreenImplementer _loadingScreen
  96. {
  97. get
  98. {
  99. return (LoadingScreenImplementer)fgcr?.Field("_loadingScreen").GetValue();
  100. }
  101. }
  102. public static IDataDB _dataDb
  103. {
  104. get
  105. {
  106. return (IDataDB)fgcr?.Field("_dataDb").GetValue();
  107. }
  108. }
  109. public static ECSResourceManagers _managers
  110. {
  111. get
  112. {
  113. return (ECSResourceManagers)fgcr?.Field("_managers").GetValue();
  114. }
  115. }
  116. public static bool _isQuitting
  117. {
  118. get
  119. {
  120. return (bool)fgcr?.Field("_isQuitting").GetValue();
  121. }
  122. }
  123. public static FasterList<EGID> _deserialisedBlockMap
  124. {
  125. get
  126. {
  127. return (FasterList<EGID>) fgcr?.Field("_deserialisedBlockMap").GetValue();
  128. }
  129. }
  130. private static Traverse fgcr;
  131. public static void Init(FullGameCompositionRoot instance)
  132. {
  133. fgcr = new Traverse(instance);
  134. FullGameFields.Instance = instance;
  135. }
  136. }
  137. }