TechbloxModdingAPI/GamecraftModdingAPI/Utility/FullGameFields.cs

171 lines
3.3 KiB
C#
Raw Normal View History

2019-12-17 01:55:52 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataLoader;
2020-05-03 19:31:09 +00:00
using HarmonyLib;
2019-12-17 01:55:52 +00:00
using RobocraftX;
using RobocraftX.Common.Utilities;
using RobocraftX.GUI;
using RobocraftX.Multiplayer;
using RobocraftX.Rendering;
using Svelto.Context;
using Svelto.ECS;
using Svelto.ECS.Schedulers.Unity;
using UnityEngine;
using Unity.Entities;
using Unity.Physics.Systems;
namespace GamecraftModdingAPI.Utility
{
/// <summary>
/// Public access to the private variables in RobocraftX.FullGameCompositionRoot
/// </summary>
public static class FullGameFields
{
public static FullGameCompositionRoot Instance
{
private set;
get;
} = null;
2019-12-17 01:55:52 +00:00
public static MultiplayerInitParameters _multiplayerParams
{
get
2019-12-17 01:55:52 +00:00
{
return (MultiplayerInitParameters)fgcr?.Field("_multiplayerParams").GetValue();
}
}
public static EnginesRoot _frontEndEnginesRoot
{
get
{
return (EnginesRoot)fgcr?.Field("_frontEndEnginesRoot").GetValue();
}
}
public static EnginesRoot _mainGameEnginesRoot
{
get
{
return (EnginesRoot)fgcr?.Field("_mainGameEnginesRoot").GetValue();
}
}
public static World _physicsWorld
{
get
{
return (World)fgcr?.Field("_physicsWorld").GetValue();
}
}
public static World _renderingWorld
{
get
{
return (World)fgcr?.Field("_renderingWorld").GetValue();
}
}
2020-04-28 13:55:08 +00:00
public static SimpleEntitiesSubmissionScheduler _mainGameSubmissionScheduler
2019-12-17 01:55:52 +00:00
{
get
{
2020-04-28 13:55:08 +00:00
return (SimpleEntitiesSubmissionScheduler)fgcr?.Field("_sub").Field("_mainGameSubmissionScheduler").GetValue();
2019-12-17 01:55:52 +00:00
}
}
public static BuildPhysicsWorld _physicsWorldSystem
{
get
{
return (BuildPhysicsWorld)fgcr?.Field("_physicsWorldSystem").GetValue();
}
}
public static UnityContext<FullGameCompositionRoot> _contextHolder
{
get
{
return (UnityContext<FullGameCompositionRoot>)fgcr?.Field("_contextHolder").GetValue();
}
}
public static GameObject _frontEndGo
{
get
{
return (GameObject)fgcr?.Field("_frontEndGo").GetValue();
}
}
public static GameObject _mainGameGo
{
get
{
return (GameObject)fgcr?.Field("_mainGameGo").GetValue();
}
}
public static PhysicsUtility _physicsUtility
{
get
{
return (PhysicsUtility)fgcr?.Field("_physicsUtility").GetValue();
}
}
2020-04-28 13:55:08 +00:00
/*public static UnityEntitySubmissionScheduler _frontEndSubmissionScheduler
2019-12-17 01:55:52 +00:00
{
get
{
return (UnityEntitySubmissionScheduler)fgcr?.Field("_frontEndSubmissionScheduler").GetValue();
}
2020-04-28 13:55:08 +00:00
}*/
2019-12-17 01:55:52 +00:00
public static LoadingScreenImplementer _loadingScreen
{
get
{
return (LoadingScreenImplementer)fgcr?.Field("_loadingScreen").GetValue();
}
}
public static IDataDB _dataDb
{
get
{
return (IDataDB)fgcr?.Field("_dataDb").GetValue();
}
}
public static ECSGameObjectResourceManager _eCsGameObjectResourceManager
{
get
{
return (ECSGameObjectResourceManager)fgcr?.Field("_eCsGameObjectResourceManager").GetValue();
}
}
public static bool _isQuitting
{
get
{
return (bool)fgcr?.Field("_isQuitting").GetValue();
}
}
private static Traverse fgcr;
public static void Init(FullGameCompositionRoot instance)
{
fgcr = new Traverse(instance);
FullGameFields.Instance = instance;
2019-12-17 01:55:52 +00:00
}
}
}