Skip to content

Commit 264f989

Browse files
committed
Rename Snapshot -> GameTick
1 parent 1efeec0 commit 264f989

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

GW2SDK.Tests/Features/Mumble/GameLinkTest.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using System.IO;
3-
using System.IO.MemoryMappedFiles;
42
using System.Threading;
53
using System.Threading.Tasks;
64
using Xunit;

GW2SDK.Tests/Features/Mumble/GameLinkTestObserver.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace GuildWars2.Tests.Features.Mumble;
77

8-
public class GameLinkTestObserver : IObserver<Snapshot>
8+
public class GameLinkTestObserver : IObserver<GameTick>
99
{
1010
private readonly TaskCompletionSource<bool> tcs;
1111

@@ -17,15 +17,15 @@ public GameLinkTestObserver(CancellationToken ct)
1717

1818
public Task<bool> Handle => tcs.Task;
1919

20-
public Snapshot First { get; private set; }
20+
public GameTick First { get; private set; }
2121

22-
public Snapshot Last { get; private set; }
22+
public GameTick Last { get; private set; }
2323

2424
public void OnCompleted() => tcs.SetResult(true);
2525

2626
public void OnError(Exception error) => tcs.SetException(error);
2727

28-
public void OnNext(Snapshot value)
28+
public void OnNext(GameTick value)
2929
{
3030
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
3131
if (First.UiTick == 0)

GW2SDK/Features/Mumble/Snapshot.cs GW2SDK/Features/Mumble/GameTick.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ namespace GuildWars2.Mumble;
77

88
[PublicAPI]
99
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
10-
public struct Snapshot
10+
public struct GameTick
11+
1112
{
1213
public readonly uint UiVersion;
1314

GW2SDK/GameLink.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace GuildWars2
1414
{
1515
[PublicAPI]
16-
public sealed class GameLink : IDisposable, IObservable<Snapshot>
16+
public sealed class GameLink : IDisposable, IObservable<GameTick>
1717
{
1818
/// <summary>The smallest allowed polling interval.</summary>
1919
public readonly TimeSpan MinimumRefreshInterval = TimeSpan.FromMilliseconds(1d);
@@ -22,7 +22,7 @@ public sealed class GameLink : IDisposable, IObservable<Snapshot>
2222
private readonly MumbleLink mumbleLink;
2323

2424
/// <summary>A list of observers who want to receive values.</summary>
25-
private readonly List<IObserver<Snapshot>> subscribers = new();
25+
private readonly List<IObserver<GameTick>> subscribers = new();
2626

2727
/// <summary>We don't get notified when the shared memory is updated, so we use a Timer to poll for changes.</summary>
2828
private readonly Timer timer;
@@ -54,7 +54,7 @@ public void Dispose()
5454
timer.Dispose();
5555
}
5656

57-
public IDisposable Subscribe(IObserver<Snapshot> observer)
57+
public IDisposable Subscribe(IObserver<GameTick> observer)
5858
{
5959
if (!subscribers.Contains(observer))
6060
{
@@ -129,6 +129,6 @@ public static GameLink Open(TimeSpan refreshInterval = default, string name = "M
129129
return new GameLink(link, refreshInterval);
130130
}
131131

132-
public Snapshot GetSnapshot() => mumbleLink.GetValue<Snapshot>();
132+
public GameTick GetSnapshot() => mumbleLink.GetValue<GameTick>();
133133
}
134134
}

0 commit comments

Comments
 (0)