49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using RebootKit.Engine.Foundation;
|
|
using RebootKit.Engine.Services.Console;
|
|
using RebootKit.Engine.Services.Game;
|
|
using RebootKit.Engine.Services.Input;
|
|
using RebootKit.Engine.Services.Simulation;
|
|
using UnityEngine.Events;
|
|
|
|
namespace RebootKit.Engine {
|
|
public partial class RR {
|
|
public static ConsoleService Console => s_Shared.m_ConsoleService;
|
|
public static InputService Input => s_Shared.m_InputService;
|
|
public static WorldService World => s_Shared.m_WorldService;
|
|
public static GameService Game => s_Shared.m_GameService;
|
|
public static DIContext DIContext => s_Shared.m_DIContext;
|
|
|
|
public static ConfigVar CVarIndex(string name, int defaultValue = -1) {
|
|
ConfigVar cvar = ConfigVarsContainer.Get(name);
|
|
if (cvar != null) {
|
|
return cvar;
|
|
}
|
|
|
|
cvar = new ConfigVar(name, defaultValue);
|
|
ConfigVarsContainer.Register(cvar);
|
|
return cvar;
|
|
}
|
|
|
|
public static ConfigVar CVarNumber(string name, double defaultValue = 0) {
|
|
ConfigVar cvar = ConfigVarsContainer.Get(name);
|
|
if (cvar != null) {
|
|
return cvar;
|
|
}
|
|
|
|
cvar = new ConfigVar(name, defaultValue);
|
|
ConfigVarsContainer.Register(cvar);
|
|
return cvar;
|
|
}
|
|
|
|
public static ConfigVar CVarString(string name, string defaultValue = "") {
|
|
ConfigVar cvar = ConfigVarsContainer.Get(name);
|
|
if (cvar != null) {
|
|
return cvar;
|
|
}
|
|
|
|
cvar = new ConfigVar(name, defaultValue);
|
|
ConfigVarsContainer.Register(cvar);
|
|
return cvar;
|
|
}
|
|
}
|
|
} |