feat(mosstank): add VTank-style automation PoC
This commit is contained in:
parent
f6fe0f2a4f
commit
4e6e9bc9d9
212 changed files with 49462 additions and 416 deletions
|
|
@ -7,6 +7,33 @@ namespace AcDream.Runtime.Tests.Gameplay;
|
|||
|
||||
public sealed class RuntimeActionStateTests
|
||||
{
|
||||
[Fact]
|
||||
public void HealthActivityPublishesMonotonicRevisionAndAgeAndResets()
|
||||
{
|
||||
double now = 10d;
|
||||
using var inventory = NewInventoryTransactions();
|
||||
using var actions = RuntimeActionTestFactory.Create(inventory, () => now);
|
||||
|
||||
actions.Combat.OnUpdateHealth(0x50000001u, 0.75f);
|
||||
now = 12.5d;
|
||||
|
||||
Assert.True(actions.TryGetHealthActivity(
|
||||
0x50000001u, out long firstRevision, out double age));
|
||||
Assert.Equal(1, firstRevision);
|
||||
Assert.Equal(2.5d, age, 3);
|
||||
|
||||
actions.Combat.OnUpdateHealth(0x50000001u, 0.5f);
|
||||
Assert.True(actions.TryGetHealthActivity(
|
||||
0x50000001u, out long secondRevision, out age));
|
||||
Assert.True(secondRevision > firstRevision);
|
||||
Assert.Equal(0d, age, 3);
|
||||
|
||||
actions.ResetSession();
|
||||
Assert.False(actions.TryGetHealthActivity(
|
||||
0x50000001u, out _, out double missingAge));
|
||||
Assert.True(double.IsPositiveInfinity(missingAge));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ViewProjectsTheExactCanonicalChildrenAndRevisions()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue