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

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

UiInteger

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

UiInteger

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

Fields

Maximum

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

Properties

Lower

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

Range

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

Upper

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

Value

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

Methods

CompareTo

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

ComputeSensibleLimits

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

Decrement

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

Equals

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

Equals

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

Equals

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

EqualsFull

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

FormatValue

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

GetHashCode

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

Increment

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

ModifyLimits

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

ModifyValue

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

ProcessValue

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

Store

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

ToString

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

ToStringFull

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

TryParse

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

TryParse

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