TriEngine  v0.0.16
General-purpose engine in C#/OpenGL
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
TriDevs.TriEngine.Extensions.IntegerExtensions Class Reference

Extensions for System.Int16, System.UInt16, System.Int32, System.UInt32, System.Int64 and System.UInt64. More...

Static Public Member Functions

static short Clamp (this short value, short min, short max)
 Clamps the specified short between a minimum and maximum value. More...
 
static ushort Clamp (this ushort value, ushort min, ushort max)
 Clamps the specified unsigned short between a minimum and maximum value. More...
 
static int Clamp (this int value, int min, int max)
 Clamps the specified integer between a minimum and maximum value. More...
 
static uint Clamp (this uint value, uint min, uint max)
 Clamps the specified unsigned integer between a minimum and maximum value. More...
 
static long Clamp (this long value, long min, long max)
 Clamps the specified 64-bit integer between a minimum and maximum value. More...
 
static ulong Clamp (this ulong value, ulong min, ulong max)
 Clamps the specified 64-bit unsigned integer between a minimum and maximum value. More...
 

Detailed Description

Extensions for System.Int16, System.UInt16, System.Int32, System.UInt32, System.Int64 and System.UInt64.

Member Function Documentation

static short TriDevs.TriEngine.Extensions.IntegerExtensions.Clamp ( this short  value,
short  min,
short  max 
)
static

Clamps the specified short between a minimum and maximum value.

Parameters
valueValue to clamp.
minIf the specified short is below this value, then this will be returned.
maxIf the specified short is above this value, then this will be returned.
Returns
The clamped value of the short.
42  {
43  return Helpers.Math.Clamp(value, min, max);
44  }

Here is the call graph for this function:

Here is the caller graph for this function:

static ushort TriDevs.TriEngine.Extensions.IntegerExtensions.Clamp ( this ushort  value,
ushort  min,
ushort  max 
)
static

Clamps the specified unsigned short between a minimum and maximum value.

Parameters
valueValue to clamp.
minIf the specified unsigned short is below this value, then this will be returned.
maxIf the specified unsigned short is above this value, then this will be returned.
Returns
The clamped value of the unsigned short.
54  {
55  return Helpers.Math.Clamp(value, min, max);
56  }
static int TriDevs.TriEngine.Extensions.IntegerExtensions.Clamp ( this int  value,
int  min,
int  max 
)
static

Clamps the specified integer between a minimum and maximum value.

Parameters
valueValue to clamp.
minIf the specified integer is below this value, then this will be returned.
maxIf the specified integer is above this value, then this will be returned.
Returns
The clamped value of the integer.
66  {
67  return Helpers.Math.Clamp(value, min, max);
68  }
static uint TriDevs.TriEngine.Extensions.IntegerExtensions.Clamp ( this uint  value,
uint  min,
uint  max 
)
static

Clamps the specified unsigned integer between a minimum and maximum value.

Parameters
valueValue to clamp.
minIf the specified unsigned integer is below this value, then this will be returned.
maxIf the specified unsigned integer is above this value, then this will be returned.
Returns
The clamped value of the unsigned integer.
78  {
79  return Helpers.Math.Clamp(value, min, max);
80  }
static long TriDevs.TriEngine.Extensions.IntegerExtensions.Clamp ( this long  value,
long  min,
long  max 
)
static

Clamps the specified 64-bit integer between a minimum and maximum value.

Parameters
valueValue to clamp.
minIf the specified 64-bit integer is below this value, then this will be returned.
maxIf the specified 64-bit integer is above this value, then this will be returned.
Returns
The clamped value of the 64-bit integer.
90  {
91  return Helpers.Math.Clamp(value, min, max);
92  }
static ulong TriDevs.TriEngine.Extensions.IntegerExtensions.Clamp ( this ulong  value,
ulong  min,
ulong  max 
)
static

Clamps the specified 64-bit unsigned integer between a minimum and maximum value.

Parameters
valueValue to clamp.
minIf the specified 64-bit unsigned integer is below this value, then this will be returned.
maxIf the specified 64-bit unsigned integer is above this value, then this will be returned.
Returns
The clamped value of the 64-bit unsigned integer.
102  {
103  return Helpers.Math.Clamp(value, min, max);
104  }

The documentation for this class was generated from the following file: