aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-10-13 20:31:42 -0500
committerJP Dillingham <jp@dillingham.me>2022-10-13 20:31:42 -0500
commit69dfdc9830324965aa5cc4f30d16a8cb60ff39f3 (patch)
treea4924bcd12dcba69aa61afeb9422b3d6d3666d62
parenta670caf1ae399448e1175a1f4e2032b22e580c4b (diff)
downloadslskd-69dfdc9830324965aa5cc4f30d16a8cb60ff39f3.tar.gz
use a record
-rw-r--r--src/slskd/Shares/Types/Host.cs18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/slskd/Shares/Types/Host.cs b/src/slskd/Shares/Types/Host.cs
index db68c48e..3c5c9f9f 100644
--- a/src/slskd/Shares/Types/Host.cs
+++ b/src/slskd/Shares/Types/Host.cs
@@ -23,7 +23,7 @@ namespace slskd.Shares
/// <summary>
/// A share host.
/// </summary>
- public class Host
+ public record Host
{
/// <summary>
/// Initializes a new instance of the <see cref="Host"/> class.
@@ -49,28 +49,16 @@ namespace slskd.Shares
/// <summary>
/// Gets the collection of hosted shares.
/// </summary>
- public IEnumerable<Share> Shares { get; private set; }
+ public IEnumerable<Share> Shares { get; init; }
/// <summary>
/// Gets the host state.
/// </summary>
- public HostState State { get; private set; }
+ public HostState State { get; init; }
/// <summary>
/// Gets the host type.
/// </summary>
public HostType Type { get; }
-
- /// <summary>
- /// Sets the hosted shares for the host.
- /// </summary>
- /// <param name="shares">The collection of shares.</param>
- public void SetShares(IEnumerable<Share> shares) => Shares = shares;
-
- /// <summary>
- /// Sets the state of the host.
- /// </summary>
- /// <param name="state">The new state.</param>
- public void SetState(HostState state) => State = state;
}
} \ No newline at end of file