mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-13 21:34:43 +01:00
Init enter game
This commit is contained in:
50
KcpSharp/Base/KcpBufferPoolRentOptions.cs
Normal file
50
KcpSharp/Base/KcpBufferPoolRentOptions.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
namespace KianaBH.KcpSharp.Base;
|
||||
|
||||
/// <summary>
|
||||
/// The options to use when renting buffers from the pool.
|
||||
/// </summary>
|
||||
public readonly struct KcpBufferPoolRentOptions : IEquatable<KcpBufferPoolRentOptions>
|
||||
{
|
||||
/// <summary>
|
||||
/// The minimum size of the buffer.
|
||||
/// </summary>
|
||||
public int Size { get; }
|
||||
|
||||
/// <summary>
|
||||
/// True if the buffer may be passed to the outside of KcpSharp. False if the buffer is only used internally in
|
||||
/// KcpSharp.
|
||||
/// </summary>
|
||||
public bool IsOutbound { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a <see cref="KcpBufferPoolRentOptions" /> with the specified parameters.
|
||||
/// </summary>
|
||||
/// <param name="size">The minimum size of the buffer.</param>
|
||||
/// <param name="isOutbound">
|
||||
/// True if the buffer may be passed to the outside of KcpSharp. False if the buffer is only used
|
||||
/// internally in KcpSharp.
|
||||
/// </param>
|
||||
public KcpBufferPoolRentOptions(int size, bool isOutbound)
|
||||
{
|
||||
Size = size;
|
||||
IsOutbound = isOutbound;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(KcpBufferPoolRentOptions other)
|
||||
{
|
||||
return Size == other.Size && IsOutbound == other.IsOutbound;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return obj is KcpBufferPoolRentOptions other && Equals(other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(Size, IsOutbound);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user