Skip to content

Commit 8d5001c

Browse files
committed
chore: modify MaaAgentClient.ctor() accessibility
1 parent 13b0abb commit 8d5001c

1 file changed

Lines changed: 3 additions & 20 deletions

File tree

src/MaaFramework.Binding.Native/MaaAgentClient.cs

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class MaaAgentClient : MaaDisposableHandle<MaaAgentClientHandle>, IMaaAge
2929
/// <remarks>
3030
/// Wrapper of <see cref="MaaAgentClientCreate"/>.
3131
/// </remarks>
32-
public MaaAgentClient(string identifier = "")
32+
protected MaaAgentClient(string identifier = "")
3333
: base(invalidHandleValue: MaaAgentClientHandle.Zero)
3434
{
3535
var handle = MaaAgentClientCreate();
@@ -40,35 +40,18 @@ public MaaAgentClient(string identifier = "")
4040
_ = Id.ThrowIfNotEquals(identifier);
4141
}
4242

43-
/// <param name="identifier">The unique identifier used to communicate with the agent server.</param>
44-
/// <param name="resource">The resource.</param>
45-
/// <inheritdoc cref="MaaAgentClient(string)"/>
46-
[SetsRequiredMembers]
47-
public MaaAgentClient(string identifier, MaaResource resource)
48-
: this(identifier)
49-
{
50-
Resource = resource;
51-
}
52-
53-
/// <inheritdoc cref="MaaAgentClient(string, MaaResource)"/>
54-
[SetsRequiredMembers]
55-
public MaaAgentClient(MaaResource resource)
56-
: this("", resource)
57-
{
58-
}
59-
6043
/// <summary>
6144
/// Creates a <see cref="MaaAgentClient"/> instance.
6245
/// </summary>
6346
/// <param name="identifier">The unique identifier used to communicate with the agent server.</param>
6447
/// <param name="resource">The resource.</param>
6548
/// <returns>The <see cref="MaaAgentClient"/> instance.</returns>
6649
public static MaaAgentClient Create(string identifier, MaaResource resource)
67-
=> new(identifier, resource);
50+
=> new(identifier) { Resource = resource, };
6851

6952
/// <inheritdoc cref="Create(string, MaaResource)"/>
7053
public static MaaAgentClient Create(MaaResource resource)
71-
=> new(resource);
54+
=> new() { Resource = resource, };
7255

7356
/// <inheritdoc/>
7457
public string Id { get; }

0 commit comments

Comments
 (0)