Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateArgumentValidationException< T >()

static Exception System.ThrowHelper.CreateArgumentValidationException< T > ( ReadOnlySequenceSegment< T > startSegment,
int startIndex,
ReadOnlySequenceSegment< T > endSegment )
inlinestaticprivate

Definition at line 99 of file ThrowHelper.cs.

100 {
101 if (startSegment == null)
102 {
103 return CreateArgumentNullException(System.ExceptionArgument.startSegment);
104 }
105 if (endSegment == null)
106 {
107 return CreateArgumentNullException(System.ExceptionArgument.endSegment);
108 }
109 if (startSegment != endSegment && startSegment.RunningIndex > endSegment.RunningIndex)
110 {
111 return CreateArgumentOutOfRangeException(System.ExceptionArgument.endSegment);
112 }
113 if ((uint)startSegment.Memory.Length < (uint)startIndex)
114 {
115 return CreateArgumentOutOfRangeException(System.ExceptionArgument.startIndex);
116 }
117 return CreateArgumentOutOfRangeException(System.ExceptionArgument.endIndex);
118 }
static Exception CreateArgumentNullException(System.ExceptionArgument argument)
static Exception CreateArgumentOutOfRangeException(System.ExceptionArgument argument)

References System.ThrowHelper.CreateArgumentNullException(), System.ThrowHelper.CreateArgumentOutOfRangeException(), System.endSegment, System.startIndex, and System.startSegment.