Skip to content

Commit 0fc634c

Browse files
authored
Merge pull request #2 from voltaney/refactor/fix-model-naming
Fix class names used in the model
2 parents 2e38d9c + 874a2c2 commit 0fc634c

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

TouchSenderInterpreter.ConsoleAppDemo/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Net.Sockets;
2-
using System.Text;
32
using System.Text.Json;
43

54
using TouchSenderInterpreter.Models;
@@ -66,7 +65,6 @@ static async Task ReceiveTouchSenderPayload(CancellationToken cts)
6665
while (true)
6766
{
6867
var receivedResults = await udpClient.ReceiveAsync(cts);
69-
var receivedText = Encoding.UTF8.GetString(receivedResults.Buffer);
7068
touchSenderResult = Interpreter.Read(receivedResults.Buffer);
7169
}
7270
}

TouchSenderInterpreter.Test/InterpreterTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace TouchSenderInterpreter.Test
1111
internal class TestDataGenerator
1212
{
1313
static readonly int ExampleId = 10;
14-
static readonly Deviceinfo FullDeviceInfo = new(Width: 1920, Height: 1080);
15-
static readonly Singletouch FullSingleTouch = new(X: 0.5, Y: 0.5);
14+
static readonly DeviceInfo FullDeviceInfo = new(Width: 1920, Height: 1080);
15+
static readonly SingleTouch FullSingleTouch = new(X: 0.5, Y: 0.5);
1616
static readonly TouchSenderPayload FullPayload = new(ExampleId, FullDeviceInfo, FullSingleTouch);
1717
public static IEnumerable<object[]> FullPayloads()
1818
{

TouchSenderInterpreter/Models/TouchSenderPayload.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,28 @@
22
{
33
public record TouchSenderPayload(
44
int Id,
5-
Deviceinfo DeviceInfo,
6-
Singletouch SingleTouch
5+
DeviceInfo DeviceInfo,
6+
SingleTouch SingleTouch
77
)
88
{
9-
public Singletouch SingleTouchRatio
9+
public SingleTouch SingleTouchRatio
1010
{
1111
get
1212
{
13-
return new Singletouch(
13+
return new SingleTouch(
1414
X: SingleTouch.X / DeviceInfo.Width,
1515
Y: SingleTouch.Y / DeviceInfo.Height
1616
);
1717
}
1818
}
1919
};
2020

21-
public record Deviceinfo(
21+
public record DeviceInfo(
2222
int Width,
2323
int Height
2424
);
2525

26-
public record Singletouch(
26+
public record SingleTouch(
2727
double? X,
2828
double? Y
2929
);

0 commit comments

Comments
 (0)