mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkReader: more readable syntax
This commit is contained in:
parent
d3ee9e325e
commit
5fa5269a11
@ -23,22 +23,14 @@ public class NetworkReader
|
||||
public int Position;
|
||||
|
||||
/// <summary>Remaining bytes that can be read, for convenience.</summary>
|
||||
public int Remaining
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => buffer.Count - Position;
|
||||
}
|
||||
public int Remaining => buffer.Count - Position;
|
||||
|
||||
/// <summary>Total buffer capacity, independent of reader position.</summary>
|
||||
public int Capacity => buffer.Count;
|
||||
|
||||
[Obsolete("NetworkReader.Length was renamed to Capacity")] // 2022-09-25
|
||||
public int Length => Capacity;
|
||||
|
||||
/// <summary>Total buffer capacity, independent of reader position.</summary>
|
||||
public int Capacity
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => buffer.Count;
|
||||
}
|
||||
|
||||
public NetworkReader(byte[] bytes)
|
||||
{
|
||||
buffer = new ArraySegment<byte>(bytes);
|
||||
|
Loading…
Reference in New Issue
Block a user