refactor(battle-node): extract ForwardWhenBothReadyHandler; share handler instances via BuildHandlers
This commit is contained in:
@@ -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>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user