refactor(runtime): expose canonical gameplay state
Move character options and movement skills into the Runtime-owned character graph, expose borrowed inventory, character, and social views, and route retained UI state commands through generation-gated typed Runtime contracts. Preserve the existing synchronous wire path while deleting the App-owned option and skill mirrors and extending normalized parity checkpoints. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
9d0d9b07e0
commit
dcb61efb5a
34 changed files with 2076 additions and 103 deletions
|
|
@ -6,6 +6,44 @@ namespace AcDream.Runtime.Tests.Gameplay;
|
|||
|
||||
public sealed class RuntimeCommunicationStateTests
|
||||
{
|
||||
[Fact]
|
||||
public void SocialViewBorrowsFriendsAndSquelchOwners()
|
||||
{
|
||||
using var state = new RuntimeCommunicationState();
|
||||
state.Friends.Apply(new AcDream.Core.Social.FriendsUpdate(
|
||||
AcDream.Core.Social.FriendsUpdateType.Full,
|
||||
[
|
||||
new AcDream.Core.Social.FriendEntry(
|
||||
0x50000001u,
|
||||
"Friend",
|
||||
Online: true,
|
||||
AppearOffline: false,
|
||||
Friends: [],
|
||||
FriendOf: []),
|
||||
]));
|
||||
state.Squelch.Replace(new AcDream.Core.Social.SquelchDatabase(
|
||||
new Dictionary<string, uint>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["account"] = 1u,
|
||||
},
|
||||
new Dictionary<uint, AcDream.Core.Social.SquelchInfo>(),
|
||||
new AcDream.Core.Social.SquelchInfo(
|
||||
string.Empty,
|
||||
false,
|
||||
new HashSet<uint> { 3u })));
|
||||
|
||||
RuntimeSocialSnapshot snapshot = state.SocialView.Snapshot;
|
||||
|
||||
Assert.Equal(1, snapshot.FriendCount);
|
||||
Assert.Equal(1, snapshot.SquelchedAccountCount);
|
||||
Assert.Equal(1, snapshot.GlobalSquelchTypeCount);
|
||||
Assert.True(state.SocialView.TryGetFriend(
|
||||
0x50000001u,
|
||||
out RuntimeFriendSnapshot friend));
|
||||
Assert.Equal("Friend", friend.Name);
|
||||
Assert.True(friend.Online);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void OwnsOneExactCommunicationGraphAndPublishesCommittedEntries()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue