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.

172 lines
3.3KB

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