mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-05-19 12:27:52 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
34 lines
853 B
C#
34 lines
853 B
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
|
|
namespace Sandbox;
|
|
|
|
public static class Launcher
|
|
{
|
|
public static int Main()
|
|
{
|
|
if ( !HasCommandLineSwitch( "-project" ) && !HasCommandLineSwitch( "-test" ) )
|
|
{
|
|
// we pass the command line, so we can pass it on to the sbox-launcher (for -game etc)
|
|
ProcessStartInfo info = new ProcessStartInfo( "sbox-launcher.exe", Environment.CommandLine );
|
|
info.UseShellExecute = true;
|
|
info.CreateNoWindow = true;
|
|
info.WorkingDirectory = System.Environment.CurrentDirectory;
|
|
|
|
Process.Start( info );
|
|
return 0;
|
|
}
|
|
|
|
var appSystem = new EditorAppSystem();
|
|
appSystem.Run();
|
|
|
|
return 0;
|
|
}
|
|
|
|
private static bool HasCommandLineSwitch( string switchName )
|
|
{
|
|
return Environment.GetCommandLineArgs().Any( arg => arg.Equals( switchName, StringComparison.OrdinalIgnoreCase ) );
|
|
}
|
|
}
|