UiInteger

References
[IoId("00000000-bd72-4608-94bd-31765e246fee")] [DebuggerDisplay("{ToStringFull(),nq}")] public sealed class UiInteger : IComparable<UiInteger>, IEquatable<UiInteger>, IStorable
An integer with controllable limits.

Constructors

UiInteger

#
Create a new limited Ui integer.
public UiInteger(
value,
Value.
lower,
Lower limit.
upper
Upper limit.
)

UiInteger

#
Create a new limitless Ui integer.
public UiInteger(
value
Value.
)

UiInteger

#
Deserialisation constructor.
public UiInteger(
reader
Reader to deserialise with.
)

Fields

Maximum

#
Represents the biggest allowed limit value.
public static readonly int Maximum

Properties

Lower

#
Gets the lower limit for this number.
public int Lower { get; }

Range

#
Gets the limit range.
public long Range { get; }

Upper

#
Gets the upper limit for this number.
public int Upper { get; }

Value

#
Gets the value of this number.
public int Value { get; }

Methods

CompareTo

#
Compare this number with another. Only the value is taken into consideration.
public int CompareTo(
other
Number to compare against.
)
Sorting key.

ComputeSensibleLimits

#
Compute sensible limits for a value.
public static void ComputeSensibleLimits(
value,
Value to encompass.
out int
lower,
Lower limit.
out int
upper
Upper limit.
)

Decrement

#
Decrement this number by the smallest possible amount.
public UiInteger Decrement()
Decremented number, or the same number of decrementation is not possible.

Equals

#
Gets whether this number is equal to some other number. Only values are considered in this equality.
public bool Equals(
other
Number to test against.
)
True if both numbers have the same value.

Equals

#
Determines whether the specified object is equal to the current object.
public override bool Equals(
obj
)
True if the value of this number is equal to the supplied number.
Object.Equals

Equals

#
Gets whether this number is equal to some other number. Only values are considered in this equality.
public bool Equals(
other
Number to test against.
)
True if both numbers have the same value.

EqualsFull

#
Gets whether this number is equal to some other number. Value, limits and decimals are all taken into consideration.
public bool EqualsFull(
other
Number to test against.
)
True if both numbers are identical.

FormatValue

#
Format a value.
public string FormatValue(
value
Value to format.
)
Formatted value.

GetHashCode

#
Serves as the default hash function.
public override int GetHashCode()
A hash code for the current object.

Increment

#
Increment this number by the smallest possible amount.
public UiInteger Increment()
Incremented number, or the same number of incrementation is not possible.

ModifyLimits

#
Change the limits of this number.
public UiInteger ModifyLimits(
lower,
New lower limit.
upper
New upper limit.
)
Modified number.

ModifyValue

#
Change the value of this number.
public UiInteger ModifyValue(
value
New value.
)
Modified number.

ProcessValue

#
Process a value by both limiting and rounding it.
public BigInteger ProcessValue(
value
Value to process.
)
Processed value.

Store

#
This method is called whenever the instance is required to serialize itself.
public void Store(
writer
Writer object to serialize with.
)
Store

ToString

#
Returns a string that represents the current object.
public override string ToString()
A string that represents the current object.
Object.ToString

ToStringFull

#
Returns a string that represents the current object.
public string ToStringFull()
A string that represents the current object.

TryParse

#
Try and parse a string as a UiInteger.
public static bool TryParse(
text,
String to parse.
number,
Parsed number or null on failure.
out string
message
Reason for failure.
)
True on success or false on failure.

TryParse

#
Try and parse a string as a UiInteger.
public static bool TryParse(
text,
String to parse.
number
Parsed number or NaN on failure.
)
True on success or false on failure.