refactor(battle-node): extract ForwardWhenBothReadyHandler; share handler instances via BuildHandlers

This commit is contained in:
gamer147
2026-06-03 14:33:26 -04:00
parent db2f711894
commit 503c382646
2 changed files with 27 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
using SVSim.BattleNode.Protocol;
namespace SVSim.BattleNode.Sessions.Dispatch.Handlers;
internal sealed class ForwardWhenBothReadyHandler : IFrameHandler
{
public IReadOnlyList<DispatchRoute> Handle(FrameDispatchContext ctx)
{
if (ctx.BothAfterReady())
return new[] { new DispatchRoute(ctx.Other, ctx.Env, false) };
return Array.Empty<DispatchRoute>();
}
}