first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace NitroxModel.Helper
{
/// <summary>
/// Environment helper for getting meta data about where and how Nitrox is running.
/// </summary>
public static class NitroxEnvironment
{
public static string ReleasePhase => IsReleaseMode ? "Alpha" : "InDev";
public static Version Version => Assembly.GetExecutingAssembly().GetName().Version;
public static DateTime BuildDate => File.GetCreationTimeUtc(Assembly.GetExecutingAssembly().Location);
public static Types Type { get; private set; } = Types.NORMAL;
public static bool IsTesting => Type == Types.TESTING;
public static bool IsNormal => Type == Types.NORMAL;
public static int CurrentProcessId
{
get
{
using Process process = Process.GetCurrentProcess();
return process.Id;
}
}
public static bool IsReleaseMode
{
get
{
#if RELEASE
return true;
#else
return false;
#endif
}
}
private static bool hasSet;
public static void Set(Types value)
{
if (hasSet)
{
throw new Exception("Environment type can only be set once");
}
Type = value;
hasSet = true;
}
public enum Types
{
NORMAL,
TESTING
}
}
}