Table of Contents

Struct Serial

Namespace
Moongate.UO.Data.Ids
Assembly
Moongate.UO.Data.dll

Represents a UO entity serial identifier.

public readonly struct Serial : IComparable<Serial>, IComparable<uint>, IEquatable<Serial>, ISpanFormattable, IFormattable, ISpanParsable<Serial>, IParsable<Serial>
Implements
Inherited Members

Constructors

Serial(uint)

public Serial(uint serial)

Parameters

serial uint

Fields

ItemOffset

public const uint ItemOffset = 1073741824

Field Value

uint

ItemOffsetSerial

public static readonly Serial ItemOffsetSerial

Field Value

Serial

MaxItemSerial

public const uint MaxItemSerial = 2129587950

Field Value

uint

MaxMobileSerial

public const uint MaxMobileSerial = 1073741823

Field Value

uint

MinusOne

public static readonly Serial MinusOne

Field Value

Serial

MobileStart

public const int MobileStart = 1

Field Value

int

Zero

public static readonly Serial Zero

Field Value

Serial

Properties

IsItem

public bool IsItem { get; }

Property Value

bool

IsMobile

public bool IsMobile { get; }

Property Value

bool

IsValid

public bool IsValid { get; }

Property Value

bool

Value

public uint Value { get; }

Property Value

uint

Methods

CompareTo(Serial)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(Serial other)

Parameters

other Serial

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

CompareTo(uint)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(uint other)

Parameters

other uint

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(Serial)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Serial other)

Parameters

other Serial

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Parse(ReadOnlySpan<char>, IFormatProvider?)

Parses a span of characters into a value.

public static Serial Parse(ReadOnlySpan<char> s, IFormatProvider? provider)

Parameters

s ReadOnlySpan<char>

The span of characters to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

Returns

Serial

The result of parsing s.

Exceptions

FormatException

s is not in the correct format.

OverflowException

s is not representable by Serial.

Parse(string)

public static Serial Parse(string s)

Parameters

s string

Returns

Serial

Parse(string, IFormatProvider?)

Parses a string into a value.

public static Serial Parse(string s, IFormatProvider? provider)

Parameters

s string

The string to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

Returns

Serial

The result of parsing s.

Exceptions

ArgumentNullException

s is null.

FormatException

s is not in the correct format.

OverflowException

s is not representable by Serial.

RandomSerial()

public static Serial RandomSerial()

Returns

Serial

ToInt32()

public int ToInt32()

Returns

int

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

ToString(string?, IFormatProvider?)

Formats the value of the current instance using the specified format.

public string ToString(string? format, IFormatProvider? formatProvider)

Parameters

format string

The format to use.

-or-

A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

formatProvider IFormatProvider

The provider to use to format the value.

-or-

A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.

Returns

string

The value of the current instance in the specified format.

TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)

Tries to format the value of the current instance into the provided span of characters.

public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)

Parameters

destination Span<char>

The span in which to write this instance's value formatted as a span of characters.

charsWritten int

When this method returns, contains the number of characters that were written in destination.

format ReadOnlySpan<char>

A span containing the characters that represent a standard or custom format string that defines the acceptable format for destination.

provider IFormatProvider

An optional object that supplies culture-specific formatting information for destination.

Returns

bool

true if the formatting was successful; otherwise, false.

TryParse(ReadOnlySpan<char>, IFormatProvider?, out Serial)

Tries to parse a span of characters into a value.

public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Serial result)

Parameters

s ReadOnlySpan<char>

The span of characters to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

result Serial

When this method returns, contains the result of successfully parsing s, or an undefined value on failure.

Returns

bool

true if s was successfully parsed; otherwise, false.

TryParse(string?, IFormatProvider?, out Serial)

Tries to parse a string into a value.

public static bool TryParse(string? s, IFormatProvider? provider, out Serial result)

Parameters

s string

The string to parse.

provider IFormatProvider

An object that provides culture-specific formatting information about s.

result Serial

When this method returns, contains the result of successfully parsing s or an undefined value on failure.

Returns

bool

true if s was successfully parsed; otherwise, false.

Operators

operator +(Serial, Serial)

public static Serial operator +(Serial left, Serial right)

Parameters

left Serial
right Serial

Returns

Serial

operator +(Serial, uint)

public static Serial operator +(Serial left, uint right)

Parameters

left Serial
right uint

Returns

Serial

operator --(Serial)

public static Serial operator --(Serial value)

Parameters

value Serial

Returns

Serial

operator ==(Serial, Serial)

public static bool operator ==(Serial left, Serial right)

Parameters

left Serial
right Serial

Returns

bool

operator ==(Serial, uint)

public static bool operator ==(Serial left, uint right)

Parameters

left Serial
right uint

Returns

bool

explicit operator uint(Serial)

public static explicit operator uint(Serial value)

Parameters

value Serial

Returns

uint

explicit operator Serial(uint)

public static explicit operator Serial(uint value)

Parameters

value uint

Returns

Serial

operator >(Serial, Serial)

public static bool operator >(Serial left, Serial right)

Parameters

left Serial
right Serial

Returns

bool

operator >(Serial, uint)

public static bool operator >(Serial left, uint right)

Parameters

left Serial
right uint

Returns

bool

operator >=(Serial, Serial)

public static bool operator >=(Serial left, Serial right)

Parameters

left Serial
right Serial

Returns

bool

operator >=(Serial, uint)

public static bool operator >=(Serial left, uint right)

Parameters

left Serial
right uint

Returns

bool

operator ++(Serial)

public static Serial operator ++(Serial value)

Parameters

value Serial

Returns

Serial

operator !=(Serial, Serial)

public static bool operator !=(Serial left, Serial right)

Parameters

left Serial
right Serial

Returns

bool

operator !=(Serial, uint)

public static bool operator !=(Serial left, uint right)

Parameters

left Serial
right uint

Returns

bool

operator <(Serial, Serial)

public static bool operator <(Serial left, Serial right)

Parameters

left Serial
right Serial

Returns

bool

operator <(Serial, uint)

public static bool operator <(Serial left, uint right)

Parameters

left Serial
right uint

Returns

bool

operator <=(Serial, Serial)

public static bool operator <=(Serial left, Serial right)

Parameters

left Serial
right Serial

Returns

bool

operator <=(Serial, uint)

public static bool operator <=(Serial left, uint right)

Parameters

left Serial
right uint

Returns

bool

operator -(Serial, Serial)

public static Serial operator -(Serial left, Serial right)

Parameters

left Serial
right Serial

Returns

Serial

operator -(Serial, uint)

public static Serial operator -(Serial left, uint right)

Parameters

left Serial
right uint

Returns

Serial