feat(headless): complete deterministic bot command parity
This commit is contained in:
parent
7e8acb74dd
commit
38e83640d9
37 changed files with 2805 additions and 295 deletions
|
|
@ -1,3 +1,5 @@
|
|||
using AcDream.Core.Combat;
|
||||
|
||||
namespace AcDream.Runtime;
|
||||
|
||||
public readonly record struct RuntimeEventStamp(
|
||||
|
|
@ -82,6 +84,12 @@ public readonly record struct RuntimePortalDelta(
|
|||
RuntimeEventStamp Stamp,
|
||||
RuntimePortalSnapshot Portal);
|
||||
|
||||
public readonly record struct RuntimeCombatDelta(
|
||||
RuntimeEventStamp Stamp,
|
||||
CombatMode Mode,
|
||||
int TrackedTargetCount,
|
||||
RuntimeCombatAttackSnapshot Attack);
|
||||
|
||||
public interface IRuntimeEventObserver
|
||||
{
|
||||
void OnLifecycle(in RuntimeLifecycleDelta delta);
|
||||
|
|
@ -97,6 +105,8 @@ public interface IRuntimeEventObserver
|
|||
void OnMovement(in RuntimeMovementDelta delta);
|
||||
|
||||
void OnPortal(in RuntimePortalDelta delta);
|
||||
|
||||
void OnCombat(in RuntimeCombatDelta delta);
|
||||
}
|
||||
|
||||
public interface IRuntimeEventSource
|
||||
|
|
@ -113,6 +123,7 @@ public enum RuntimeTraceKind
|
|||
Chat,
|
||||
Movement,
|
||||
Portal,
|
||||
Combat,
|
||||
Checkpoint,
|
||||
}
|
||||
|
||||
|
|
@ -278,6 +289,20 @@ public sealed class RuntimeTraceRecorder : IRuntimeEventObserver
|
|||
$"{delta.Portal.IsReady}:{delta.Portal.IsMaterialized}:" +
|
||||
$"{delta.Portal.IsCompleted}:{delta.Portal.IsCancelled}:" +
|
||||
$"{delta.Portal.IsWorldVisible}"));
|
||||
|
||||
public void OnCombat(in RuntimeCombatDelta delta) =>
|
||||
_entries.Add(new RuntimeTraceEntry(
|
||||
delta.Stamp,
|
||||
RuntimeTraceKind.Combat,
|
||||
(int)delta.Mode,
|
||||
delta.Attack.Revision,
|
||||
(uint)delta.TrackedTargetCount,
|
||||
0u,
|
||||
$"{(int)delta.Attack.RequestedHeight}:" +
|
||||
$"{BitConverter.SingleToInt32Bits(delta.Attack.DesiredPower):X8}:" +
|
||||
$"{BitConverter.SingleToInt32Bits(delta.Attack.PowerBarLevel):X8}:" +
|
||||
$"{delta.Attack.BuildInProgress}:" +
|
||||
$"{delta.Attack.RequestInProgress}"));
|
||||
}
|
||||
|
||||
/// <summary>Monotonic sequence owner for one runtime instance.</summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue