neon-sprawl/server/NeonSprawl.Server/Game/Interaction/InteractablesWorldApi.cs

24 lines
742 B
C#

namespace NeonSprawl.Server.Game.Interaction;
/// <summary>Maps <c>GET /game/world/interactables</c> (NEO-25).</summary>
public static class InteractablesWorldApi
{
public static WebApplication MapInteractablesWorldApi(this WebApplication app)
{
app.MapGet(
"/game/world/interactables",
() =>
{
var rows = PrototypeInteractableRegistry.GetOrderedDescriptors();
return Results.Json(
new InteractablesListResponse
{
SchemaVersion = InteractablesListResponse.CurrentSchemaVersion,
Interactables = rows,
});
});
return app;
}
}