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.

FullGameFields.cs 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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.Unity;
  17. using UnityEngine;
  18. using Unity.Entities;
  19. using Unity.Physics.Systems;
  20. namespace GamecraftModdingAPI.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 SimpleEntitiesSubmissionScheduler _mainGameSubmissionScheduler
  68. {
  69. get
  70. {
  71. return (SimpleEntitiesSubmissionScheduler)fgcr?.Field("_sub").Field("_mainGameSubmissionScheduler").GetValue();
  72. }
  73. }
  74. public static BuildPhysicsWorld _physicsWorldSystem
  75. {
  76. get
  77. {
  78. return (BuildPhysicsWorld)fgcr?.Field("_physicsWorldSystem").GetValue();
  79. }
  80. }
  81. public static UnityContext<FullGameCompositionRoot> _contextHolder
  82. {
  83. get
  84. {
  85. return (UnityContext<FullGameCompositionRoot>)fgcr?.Field("_contextHolder").GetValue();
  86. }
  87. }
  88. public static GameObject _frontEndGo
  89. {
  90. get
  91. {
  92. return (GameObject)fgcr?.Field("_frontEndGo").GetValue();
  93. }
  94. }
  95. public static GameObject _mainGameGo
  96. {
  97. get
  98. {
  99. return (GameObject)fgcr?.Field("_mainGameGo").GetValue();
  100. }
  101. }
  102. public static PhysicsUtility _physicsUtility
  103. {
  104. get
  105. {
  106. return (PhysicsUtility)fgcr?.Field("_physicsUtility").GetValue();
  107. }
  108. }
  109. /*public static UnityEntitySubmissionScheduler _frontEndSubmissionScheduler
  110. {
  111. get
  112. {
  113. return (UnityEntitySubmissionScheduler)fgcr?.Field("_frontEndSubmissionScheduler").GetValue();
  114. }
  115. }*/
  116. public static LoadingScreenImplementer _loadingScreen
  117. {
  118. get
  119. {
  120. return (LoadingScreenImplementer)fgcr?.Field("_loadingScreen").GetValue();
  121. }
  122. }
  123. public static IDataDB _dataDb
  124. {
  125. get
  126. {
  127. return (IDataDB)fgcr?.Field("_dataDb").GetValue();
  128. }
  129. }
  130. public static ECSGameObjectResourceManager _eCsGameObjectResourceManager
  131. {
  132. get
  133. {
  134. return (ECSGameObjectResourceManager)fgcr?.Field("_eCsGameObjectResourceManager").GetValue();
  135. }
  136. }
  137. public static bool _isQuitting
  138. {
  139. get
  140. {
  141. return (bool)fgcr?.Field("_isQuitting").GetValue();
  142. }
  143. }
  144. public static FasterList<EGID> _deserialisedBlockMap
  145. {
  146. get
  147. {
  148. return (FasterList<EGID>) fgcr?.Field("_deserialisedBlockMap").GetValue();
  149. }
  150. }
  151. private static Traverse fgcr;
  152. public static void Init(FullGameCompositionRoot instance)
  153. {
  154. fgcr = new Traverse(instance);
  155. FullGameFields.Instance = instance;
  156. }
  157. }
  158. }