Struct GorgonRangeM
A type that represents a range between two decimal values.
Inherited Members
Namespace: Gorgon.Core
Assembly: Gorgon.Core.dll
Syntax
public readonly struct GorgonRangeM : IGorgonEquatableByRef<GorgonRangeM>, IEquatable<GorgonRangeM>, IComparable<GorgonRangeM>
Remarks
This a means to determine the range between a minimum decimal value and a maximum decimal value. Use this object to determine if a value falls within a specific range of values.
Constructors
| Edit this page View SourceGorgonRangeM(GorgonRangeM)
Initializes a new instance of the GorgonRangeM struct.
Declaration
public GorgonRangeM(GorgonRangeM minMax)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | minMax | The min max value to copy. |
GorgonRangeM(decimal, decimal)
Initializes a new instance of the GorgonRangeM struct.
Declaration
public GorgonRangeM(decimal min, decimal max)
Parameters
Type | Name | Description |
---|---|---|
decimal | min | The minimum value. |
decimal | max | The maximum value. |
Fields
| Edit this page View SourceEmpty
An empty range value.
Declaration
public static readonly GorgonRangeM Empty
Field Value
Type | Description |
---|---|
GorgonRangeM |
Maximum
The maximum value in the range.
Declaration
public readonly decimal Maximum
Field Value
Type | Description |
---|---|
decimal |
Minimum
The minimum value in the range.
Declaration
public readonly decimal Minimum
Field Value
Type | Description |
---|---|
decimal |
Properties
| Edit this page View SourceIsEmpty
Property to return whether the range is empty or not.
Declaration
[JsonIgnore]
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
Range
Property to return the range between the two values.
Declaration
[JsonIgnore]
public decimal Range { get; }
Property Value
Type | Description |
---|---|
decimal |
Methods
| Edit this page View SourceAdd(GorgonRangeM, GorgonRangeM)
Function to add two GorgonRangeM values together.
Declaration
public static GorgonRangeM Add(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left GorgonRangeM value to add |
GorgonRangeM | right | The right GorgonRangeM value to add. |
Returns
Type | Description |
---|---|
GorgonRangeM | A new GorgonRangeM representing the total of both ranges. |
Add(in GorgonRangeM, in GorgonRangeM, out GorgonRangeM)
Function to add two GorgonRangeM values together.
Declaration
public static void Add(in GorgonRangeM left, in GorgonRangeM right, out GorgonRangeM result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left GorgonRangeM value to add |
GorgonRangeM | right | The right GorgonRangeM value to add. |
GorgonRangeM | result | A new GorgonRangeM representing the total of both ranges. |
CompareTo(GorgonRangeM)
Compares the current object with another object of the same type.
Declaration
public int CompareTo(GorgonRangeM other)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: Value Meaning Less than zero This object is less than the other parameter.Zero This object is equal to other. Greater than zero This object is greater than other. |
Contains(decimal)
Function to return whether the decimal value falls within this GorgonRangeM.
Declaration
public bool Contains(decimal value)
Parameters
Type | Name | Description |
---|---|---|
decimal | value | Value to test. |
Returns
Type | Description |
---|---|
bool | true if the value falls into the range, false if not. |
Divide(GorgonRangeM, decimal)
Function to divide a GorgonRangeM by a decimal value.
Declaration
public static GorgonRangeM Divide(GorgonRangeM range, decimal scalar)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The GorgonRangeM range value to divide. |
decimal | scalar | The decimal scalar value to divide by. |
Returns
Type | Description |
---|---|
GorgonRangeM | A new GorgonRangeM representing the product of the |
Exceptions
Type | Condition |
---|---|
DivideByZeroException | Thrown if the |
Divide(in GorgonRangeM, decimal, out GorgonRangeM)
Function to divide a GorgonRangeM by a decimal value.
Declaration
public static void Divide(in GorgonRangeM range, decimal scalar, out GorgonRangeM result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The GorgonRangeM range value to divide. |
decimal | scalar | The decimal scalar value to divide by. |
GorgonRangeM | result | A new GorgonRangeM representing the product of the |
Exceptions
Type | Condition |
---|---|
DivideByZeroException | Thrown if the |
Equals(GorgonRangeM)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(GorgonRangeM other)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(in GorgonRangeM)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(in GorgonRangeM other)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | Another object to compare to. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
| Edit this page View SourceExpand(GorgonRangeM, decimal)
Function to expand a GorgonRangeM by a specific amount.
Declaration
public static GorgonRangeM Expand(GorgonRangeM range, decimal amount)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | A GorgonRangeM to expand. |
decimal | amount | The amount to expand the GorgonRangeM by. |
Returns
Type | Description |
---|---|
GorgonRangeM | A new GorgonRangeM value, increased in size by |
Expand(in GorgonRangeM, decimal, out GorgonRangeM)
Function to expand a GorgonRangeM by a specific amount.
Declaration
public static void Expand(in GorgonRangeM range, decimal amount, out GorgonRangeM result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | A GorgonRangeM to expand. |
decimal | amount | The amount to expand the GorgonRangeM by. |
GorgonRangeM | result | A new GorgonRangeM value, increased in size by |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceMultiply(GorgonRangeM, GorgonRangeM)
Function to multiply two GorgonRangeM ranges together.
Declaration
public static GorgonRangeM Multiply(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left GorgonRangeM value to multiply. |
GorgonRangeM | right | The right GorgonRangeM value to multiply. |
Returns
Type | Description |
---|---|
GorgonRangeM | A new GorgonRangeM value representing the product of both ranges. |
Multiply(GorgonRangeM, decimal)
Function to multiply a GorgonRangeM by a scalar decimal value.
Declaration
public static GorgonRangeM Multiply(GorgonRangeM range, decimal scalar)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The range to multiply by. |
decimal | scalar | The decimal scalar value to multiply. |
Returns
Type | Description |
---|---|
GorgonRangeM | A new GorgonRangeM representing the product of the |
Multiply(in GorgonRangeM, in GorgonRangeM, out GorgonRangeM)
Function to multiply two GorgonRangeM ranges together.
Declaration
public static void Multiply(in GorgonRangeM left, in GorgonRangeM right, out GorgonRangeM result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left GorgonRangeM value to multiply. |
GorgonRangeM | right | The right GorgonRangeM value to multiply. |
GorgonRangeM | result | A new GorgonRangeM value representing the product of both ranges. |
Multiply(in GorgonRangeM, decimal, out GorgonRangeM)
Function to multiply a GorgonRangeM by a scalar decimal value.
Declaration
public static void Multiply(in GorgonRangeM range, decimal scalar, out GorgonRangeM result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The range to multiply by. |
decimal | scalar | The decimal scalar value to multiply. |
GorgonRangeM | result | A new GorgonRangeM representing the product of the |
Shrink(GorgonRangeM, decimal)
Function to shrink a GorgonRangeM by a specific amount.
Declaration
public static GorgonRangeM Shrink(GorgonRangeM range, decimal amount)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | A GorgonRangeM to shrink. |
decimal | amount | The amount to shrink the GorgonRangeM by. |
Returns
Type | Description |
---|---|
GorgonRangeM | A new GorgonRangeM value, decreased in size by |
Shrink(in GorgonRangeM, decimal, out GorgonRangeM)
Function to shrink a GorgonRangeM by a specific amount.
Declaration
public static void Shrink(in GorgonRangeM range, decimal amount, out GorgonRangeM result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | A GorgonRangeM to shrink. |
decimal | amount | The amount to shrink the GorgonRangeM by. |
GorgonRangeM | result | A new GorgonRangeM value, decreased in size by |
Subtract(GorgonRangeM, GorgonRangeM)
Function to subtract two GorgonRangeM ranges from each other.
Declaration
public static GorgonRangeM Subtract(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left GorgonRangeM value to subtract. |
GorgonRangeM | right | The right GorgonRangeM value to subtract. |
Returns
Type | Description |
---|---|
GorgonRangeM | A new GorgonRangeM value representing the difference of both ranges. |
Subtract(in GorgonRangeM, in GorgonRangeM, out GorgonRangeM)
Function to subtract two GorgonRangeM ranges from each other.
Declaration
public static void Subtract(in GorgonRangeM left, in GorgonRangeM right, out GorgonRangeM result)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left GorgonRangeM value to subtract. |
GorgonRangeM | right | The right GorgonRangeM value to subtract. |
GorgonRangeM | result | A new GorgonRangeM value representing the difference of both ranges. |
ToGorgonRange(GorgonRangeM)
Function to perform an explicit conversion from GorgonRangeM to GorgonRange.
Declaration
public static GorgonRange ToGorgonRange(GorgonRangeM range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The range. |
Returns
Type | Description |
---|---|
GorgonRange | The result of the conversion. |
ToGorgonRangeD(GorgonRangeM)
Function to perform an explicit conversion from GorgonRangeM to GorgonRangeD.
Declaration
public static GorgonRangeD ToGorgonRangeD(GorgonRangeM range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The range. |
Returns
Type | Description |
---|---|
GorgonRangeD | The result of the conversion. |
ToGorgonRangeF(GorgonRangeM)
Function to perform an explicit conversion from GorgonRangeM to GorgonRangeF.
Declaration
public static GorgonRangeF ToGorgonRangeF(GorgonRangeM range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The range. |
Returns
Type | Description |
---|---|
GorgonRangeF | The result of the conversion. |
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string containing a fully qualified type name. |
Overrides
Operators
| Edit this page View Sourceoperator +(GorgonRangeM, GorgonRangeM)
Implements the operator +.
Declaration
public static GorgonRangeM operator +(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left range. |
GorgonRangeM | right | The right range. |
Returns
Type | Description |
---|---|
GorgonRangeM | The result of the operator. |
operator /(GorgonRangeM, decimal)
Implements the operator /.
Declaration
public static GorgonRangeM operator /(GorgonRangeM left, decimal scalar)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left range. |
decimal | scalar | The right scalar value. |
Returns
Type | Description |
---|---|
GorgonRangeM | The result of the operator. |
operator ==(GorgonRangeM, GorgonRangeM)
Implements the operator ==.
Declaration
public static bool operator ==(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left. |
GorgonRangeM | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
explicit operator GorgonRange(GorgonRangeM)
Performs an explicit conversion from GorgonRangeM to GorgonRange.
Declaration
public static explicit operator GorgonRange(GorgonRangeM range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The range. |
Returns
Type | Description |
---|---|
GorgonRange | The result of the conversion. |
explicit operator GorgonRangeD(GorgonRangeM)
Performs an explicit conversion from GorgonRangeM to GorgonRangeD.
Declaration
public static explicit operator GorgonRangeD(GorgonRangeM range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The range. |
Returns
Type | Description |
---|---|
GorgonRangeD | The result of the conversion. |
explicit operator GorgonRangeF(GorgonRangeM)
Performs an explicit conversion from GorgonRangeM to GorgonRangeF.
Declaration
public static explicit operator GorgonRangeF(GorgonRangeM range)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | range | The range. |
Returns
Type | Description |
---|---|
GorgonRangeF | The result of the conversion. |
operator >(GorgonRangeM, GorgonRangeM)
Implements the operator >.
Declaration
public static bool operator >(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left instance to compare. |
GorgonRangeM | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if left is greater than right. |
operator >=(GorgonRangeM, GorgonRangeM)
Implements the operator >=.
Declaration
public static bool operator >=(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left instance to compare. |
GorgonRangeM | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if left is greater than right. |
operator !=(GorgonRangeM, GorgonRangeM)
Implements the operator ==.
Declaration
public static bool operator !=(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left. |
GorgonRangeM | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator <(GorgonRangeM, GorgonRangeM)
Implements the operator >.
Declaration
public static bool operator <(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left instance to compare. |
GorgonRangeM | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if left is greater than right. |
operator <=(GorgonRangeM, GorgonRangeM)
Implements the operator >=.
Declaration
public static bool operator <=(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left instance to compare. |
GorgonRangeM | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if left is greater than right. |
operator *(GorgonRangeM, GorgonRangeM)
Implements the operator *.
Declaration
public static GorgonRangeM operator *(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left range. |
GorgonRangeM | right | The right range. |
Returns
Type | Description |
---|---|
GorgonRangeM | The result of the operator. |
operator *(GorgonRangeM, decimal)
Implements the operator *.
Declaration
public static GorgonRangeM operator *(GorgonRangeM left, decimal scalar)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left range. |
decimal | scalar | The right scalar value. |
Returns
Type | Description |
---|---|
GorgonRangeM | The result of the operator. |
operator *(decimal, GorgonRangeM)
Implements the operator *.
Declaration
public static GorgonRangeM operator *(decimal scalar, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
decimal | scalar | The scalar value. |
GorgonRangeM | right | The right scalar value. |
Returns
Type | Description |
---|---|
GorgonRangeM | The result of the operator. |
operator -(GorgonRangeM, GorgonRangeM)
Implements the operator -.
Declaration
public static GorgonRangeM operator -(GorgonRangeM left, GorgonRangeM right)
Parameters
Type | Name | Description |
---|---|---|
GorgonRangeM | left | The left range. |
GorgonRangeM | right | The right range. |
Returns
Type | Description |
---|---|
GorgonRangeM | The result of the operator. |