some breaking changes, mostly style stuff

This commit is contained in:
Cassandra de la Cruz-Munoz 2023-08-17 14:19:26 -04:00
parent 3ff6e776ba
commit f5f3a5e527
4 changed files with 14 additions and 14 deletions

View File

@ -21,11 +21,11 @@ using System.Text.RegularExpressions;
namespace godotOscSharp
{
public class Address
public class OscAddress
{
public string Pattern { get; }
public Address(string pattern)
public OscAddress(string pattern)
{
if (string.IsNullOrEmpty(pattern))
{
@ -63,7 +63,7 @@ namespace godotOscSharp
return result.ToArray();
}
public static Address Parse(byte[] data, ref int index)
public static OscAddress Parse(byte[] data, ref int index)
{
var start = index;
while (data[index] != 0)
@ -74,7 +74,7 @@ namespace godotOscSharp
index++;
var padding = 4 - ((index - start) % 4);
index += padding;
return new Address(pattern);
return new OscAddress(pattern);
}
public override string ToString()

View File

@ -26,16 +26,16 @@ namespace godotOscSharp
{
public class OscMessage
{
public Address Address { get; }
public OscAddress Address { get; }
public List<OscArgument> Data { get; }
public OscMessage(Address address)
public OscMessage(OscAddress address)
{
Address = address;
}
public OscMessage(Address address, List<OscArgument> data)
public OscMessage(OscAddress address, List<OscArgument> data)
{
Address = address;
Data = data;
@ -44,7 +44,7 @@ namespace godotOscSharp
public static OscMessage Parse(byte[] data)
{
var index = 0;
var address = Address.Parse(data, ref index);
var address = OscAddress.Parse(data, ref index);
var start = index;
while (data[index] != 0)
{

View File

@ -28,10 +28,10 @@ namespace godotOscSharp
public class OscReceiver : IDisposable
{
// The UDP client for receiving data
private UdpClient udpClient;
private readonly UdpClient udpClient;
// The thread for listening to incoming messages
private Thread listenThread;
private readonly Thread listenThread;
// The flag to indicate if the receiver is running
private bool running;

View File

@ -24,15 +24,15 @@ namespace godotOscSharp
{
public class OscSender : IDisposable
{
private UdpClient udpClient;
private readonly UdpClient udpClient;
private IPAddress host;
private readonly IPAddress host;
private int port;
private readonly int port;
public OscSender(IPAddress host, int port)
{
udpClient = new UdpClient(0);
udpClient = new UdpClient(port);
this.host = host;
this.port = port;
}