It makes use of System.CommandLine to have implement the application as a CLI.
While all other projects were C# Class Library projects, this one produces an executable that's the actual, assembled application.
It contains the Program.cs file that melt the shards into the forge and run it, plus a couple of configuration files that you can inspect to see different configuration combinations.
usingSystem.CommandLine;usingSystem.CommandLine.Invocation;usingSystem.Threading.Tasks;usingMithrilShards.Core.Forge;usingMithrilShards.Dev.Controller;usingMithrilShards.Diagnostic.StatisticsCollector;usingMithrilShards.Example.Dev;usingMithrilShards.Example.Network.Bedrock;usingMithrilShards.Example.Protocol;usingMithrilShards.Logging.Serilog;usingMithrilShards.Network.Bedrock;usingSerilog;namespaceMithrilShards.Example.Node{staticclassProgram{staticasyncTaskMain(string[]args){// Create a root command with some optionsvarrootCommand=newRootCommand{newOption<string>("--settings",getDefaultValue:()=>"forge-settings.json",description:"Specify the path to the forge settings file."),newOption<string?>("--log-settings",getDefaultValue:()=>null,description:"Specify the path to the forge log settings file. If not specified, try to get logging information from the main forge settings file."),newOption<int>("--protocol-version",getDefaultValue:()=>KnownVersion.CurrentVersion,description:"Specify the path to the forge settings file.")};rootCommand.Description="Example App";rootCommand.TreatUnmatchedTokensAsErrors=false;// Note that the parameters of the handler method are matched according to the names of the optionsrootCommand.Handler=CommandHandler.Create<string,string,int>(async(settings,logSettings,protocolVersion)=>{awaitnewForgeBuilder().UseForge<DefaultForge>(args,settings).UseSerilog(logSettings).UseBedrockNetwork<ExampleNetworkProtocolMessageSerializer>().UseStatisticsCollector(options=>options.DumpOnConsoleOnKeyPress=true)/// we are injecting ExampleDev type to allow <see cref="MithrilShards.WebApi.WebApiShard"/> to find all the controllers/// defined there because only controllers defined in an included shard assemblies are discovered automatically./// Passing ExampleDev will cause dotnet runtime to load the assembly where ExampleDev Type is defined and every/// controllers defined there will be found later during <see cref="MithrilShards.WebApi.WebApiShard"/> initialization..UseApi(options=>options.ControllersSeeker=(seeker)=>seeker.LoadAssemblyFromType<ExampleDev>()).UseDevController().UseExample(KnownVersion.V1,protocolVersion).RunConsoleAsync().ConfigureAwait(false);});awaitrootCommand.InvokeAsync(args).ConfigureAwait(false);}}}