using System.Diagnostics; using System.Reflection; using System.Text; using ArcaneLibs; using ArcaneLibs.Extensions; using Rhea; using Rhea.Nar; // new NarWriter().GetHeader().ToArray().HexDump(64); foreach (var fieldInfo in typeof(NarConsts).GetFields()) { // Console.WriteLine(fieldInfo); var rawBytes = (byte[])fieldInfo.GetValue(null)!; var sizeBytes = rawBytes[..8]; var dataBytes = rawBytes[8..]; Console.WriteLine( $$""" public static readonly byte[] {{fieldInfo.Name}} = new byte[] { {{string.Join(", ", sizeBytes.Select(x => x.ToString()))}}, // {{dataBytes.Trim((byte)0).ToArray().Length}} bytes {{string.Join(", ", dataBytes.Select(x => x.ToString()))}}, // "{{Encoding.UTF8.GetString(dataBytes)}}"u8 + padding {{string.Join(", ", rawBytes.Select(x => x.ToString()))}} }; """ ); } return; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllers(); // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi builder.Services.AddOpenApi(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { app.MapOpenApi(); } app.UseAuthorization(); app.MapControllers(); // app.Run();