using NeonSprawl.Server.Game.AbilityInput;
using NeonSprawl.Server.Game.Interaction;
using NeonSprawl.Server.Game.PositionState;
using NeonSprawl.Server.Game.Targeting;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddPositionStateStore(builder.Configuration);
builder.Services.AddHotbarLoadoutStore(builder.Configuration);
builder.Services.AddSingleton<IPlayerTargetLockStore, InMemoryPlayerTargetLockStore>();

var app = builder.Build();

app.MapGet("/", () => Results.Text(
    "Neon Sprawl game server — GET /health for JSON status.",
    "text/plain"));

app.MapGet("/health", () => Results.Json(new
{
    status = "ok",
    service = "NeonSprawl.Server",
}));

app.MapPositionStateApi();
app.MapInteractionApi();
app.MapInteractablesWorldApi();
app.MapTargetingApi();
app.MapHotbarLoadoutApi();

app.Run();
