Skip to content

Commit 44e5174

Browse files
committed
allow access to sdk constants
1 parent 3c74ed6 commit 44e5174

File tree

10 files changed

+26
-23
lines changed

10 files changed

+26
-23
lines changed

benchmarks/Backdash.Benchmarks.Ping/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Backdash.Core;
44
using Backdash.Network.Client;
55
using Backdash.Serialization.Internal;
6+
using static Backdash.Core.NetcodeConstants;
67

78
var totalDuration = TimeSpan.FromSeconds(10);
89
var snapshotInterval = TimeSpan.FromSeconds(0);

src/Backdash/Core/Max.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2+
global using Max = Backdash.Core.NetcodeConstants.Max;
3+
4+
namespace Backdash.Core;
5+
6+
/// <summary>
7+
/// SDK constant values
8+
/// </summary>
9+
public static class NetcodeConstants
10+
{
11+
/// <summary>
12+
/// maximum values
13+
/// </summary>
14+
public static class Max
15+
{
16+
public const int NumberOfPlayers = 4;
17+
public const int NumberOfSpectators = 32;
18+
public const int CompressedBytes = 512;
19+
public const int UdpPacketSize = 65_527;
20+
public const int PackageQueue = 64;
21+
}
22+
}

src/Backdash/Options/NetcodeOptions.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Backdash.Core;
21
using Backdash.Network;
32
using Backdash.Network.Client;
43
using Backdash.Synchronizing.State;
@@ -20,8 +19,8 @@ public sealed record NetcodeOptions
2019
public int LocalPort { get; set; }
2120

2221
/// <summary>
23-
/// Number of players
24-
/// Can not be greater than <see cref="Max.NumberOfPlayers" />
22+
/// Session number of players
23+
/// Can't be greater than <see cref="Max.NumberOfPlayers" />
2524
/// </summary>
2625
/// <value>Defaults to <c>2</c></value>
2726
public int NumberOfPlayers { get; set; } = 2;

src/Backdash/Options/ProtocolOptions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Backdash.Core;
21
using Backdash.Network;
32
using Backdash.Network.Client;
43

src/Backdash/ResultCode.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using Backdash.Core;
21
using Backdash.Options;
32

43
namespace Backdash;

tests/Backdash.Tests/TestUtils/Fixtures/BinarySerializerFixture.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Buffers;
2-
using Backdash.Core;
32
using Backdash.Network;
43
using Backdash.Serialization;
54

tests/Backdash.Tests/TestUtils/Gen.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Numerics;
2-
using Backdash.Core;
32
using Backdash.Data;
43
using Backdash.Network;
54

tests/Backdash.Tests/TestUtils/TestGenerators.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Drawing;
22
using System.Numerics;
33
using System.Text;
4-
using Backdash.Core;
54
using Backdash.Data;
65
using Backdash.Network.Messages;
76
using Backdash.Synchronizing.Input;

tests/Backdash.Tests/Usings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
global using FluentAssertions;
77
global using FsCheck;
88
global using Xunit;
9+
global using Max = Backdash.Core.NetcodeConstants.Max;
910
global using GameInput = Backdash.Synchronizing.Input.GameInput<Backdash.Tests.TestUtils.TestInput>;
1011
global using Random = System.Random;

0 commit comments

Comments
 (0)