refactor(input): extract the gameplay frame

This commit is contained in:
Erik 2026-07-22 01:38:40 +02:00
parent 0bc9fda9de
commit c557038353
24 changed files with 2433 additions and 559 deletions

View file

@ -11,13 +11,18 @@ namespace AcDream.App.Input;
/// </summary>
public sealed class LocalPlayerOutboundController
{
private readonly Action<string, uint, MovementResult, Vector3, uint, byte> _diagnostic;
private readonly IMovementTruthDiagnosticSink _diagnostic;
internal LocalPlayerOutboundController(IMovementTruthDiagnosticSink diagnostic)
{
_diagnostic = diagnostic
?? throw new ArgumentNullException(nameof(diagnostic));
}
public LocalPlayerOutboundController(
Action<string, uint, MovementResult, Vector3, uint, byte> diagnostic)
{
_diagnostic = diagnostic
?? throw new ArgumentNullException(nameof(diagnostic));
_diagnostic = new DelegateMovementTruthDiagnosticSink(diagnostic);
}
/// <summary>
@ -107,7 +112,7 @@ public sealed class LocalPlayerOutboundController
teleportSequence: session.TeleportSequence,
forcePositionSequence: session.ForcePositionSequence,
lastContact: contactByte);
_diagnostic(
_diagnostic.OnOutbound(
"AP",
sequence,
movement,
@ -193,7 +198,7 @@ public sealed class LocalPlayerOutboundController
forcePositionSequence: session.ForcePositionSequence,
contact: contactByte != 0,
standingLongjump: false);
_diagnostic(
_diagnostic.OnOutbound(
"MTS",
sequence,
movement,