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;
|
2020-11-10 18:28:36 +00:00
|
|
|
|
using Svelto.DataStructures;
|
2019-12-17 01:55:52 +00:00
|
|
|
|
using Svelto.ECS;
|
2020-12-11 16:11:24 +00:00
|
|
|
|
using Svelto.ECS.Schedulers;
|
2019-12-17 01:55:52 +00:00
|
|
|
|
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
|
|
|
|
|
{
|
2020-06-18 01:04:08 +00:00
|
|
|
|
public static FullGameCompositionRoot Instance
|
|
|
|
|
{
|
|
|
|
|
private set;
|
|
|
|
|
get;
|
|
|
|
|
} = null;
|
|
|
|
|
|
2019-12-17 01:55:52 +00:00
|
|
|
|
public static MultiplayerInitParameters _multiplayerParams
|
2020-06-18 01:04:08 +00:00
|
|
|
|
{
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-10 18:28:36 +00:00
|
|
|
|
public static FasterList<EGID> _deserialisedBlockMap
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (FasterList<EGID>) fgcr?.Field("_deserialisedBlockMap").GetValue();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-17 01:55:52 +00:00
|
|
|
|
private static Traverse fgcr;
|
|
|
|
|
|
|
|
|
|
public static void Init(FullGameCompositionRoot instance)
|
|
|
|
|
{
|
|
|
|
|
fgcr = new Traverse(instance);
|
2020-06-18 01:04:08 +00:00
|
|
|
|
FullGameFields.Instance = instance;
|
2019-12-17 01:55:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|