Struct ItemStepPair<TItem>
An item added to a generation context component and the name of the step that added it.
Assembly: GoRogue.dll
Syntax
[DataContract]
public readonly struct ItemStepPair<TItem> : IEquatable<ItemStepPair<TItem>>, IMatchable<ItemStepPair<TItem>> where TItem : notnull
Type Parameters
Name |
Description |
TItem |
The type of item stored in the pairing.
|
Constructors
View Source
ItemStepPair(TItem, string)
Declaration
public ItemStepPair(TItem item, string step)
Parameters
Type |
Name |
Description |
TItem |
item |
|
string |
step |
|
Fields
View Source
Item
Declaration
[DataMember]
public readonly TItem Item
Field Value
View Source
Step
The name associated with the step that created the item.
Declaration
[DataMember]
public readonly string Step
Field Value
Methods
View Source
Deconstruct(out TItem, out string)
Supports C# Deconstruction syntax.
Declaration
public void Deconstruct(out TItem item, out string step)
Parameters
Type |
Name |
Description |
TItem |
item |
|
string |
step |
|
View Source
Equals(ItemStepPair<TItem>)
True if the given pair has equivalent items and that were generated by the same step; false otherwise.
Declaration
public bool Equals(ItemStepPair<TItem> other)
Parameters
Returns
View Source
Equals(object?)
True if the given object is an ItemStepPair that has an equivalent item that was generated by the same step;
false otherwise.
Declaration
public override bool Equals(object? obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
View Source
FromTuple((TItem item, string step))
Converts the tuple to an equivalent ItemStepPair.
Declaration
public static ItemStepPair<TItem> FromTuple((TItem item, string step) tuple)
Parameters
Returns
View Source
GetHashCode()
Returns a hash code based on all of the pair's fields.
Declaration
public override int GetHashCode()
Returns
Overrides
View Source
Matches(ItemStepPair<TItem>)
True if the given pair has equivalent items and that were generated by the same step; false otherwise.
Declaration
public bool Matches(ItemStepPair<TItem> other)
Parameters
Returns
View Source
ToString()
Returns a string representing the item and the name of the step that added it.
Declaration
public override string ToString()
Returns
Overrides
View Source
ToTuple()
Converts the pair to an equivalent tuple.
Declaration
public (TItem item, string step) ToTuple()
Returns
Operators
View Source
operator ==(ItemStepPair<TItem>, ItemStepPair<TItem>)
True if the given pairs have the same component and tag; false otherwise.
Declaration
public static bool operator ==(ItemStepPair<TItem> left, ItemStepPair<TItem> right)
Parameters
Returns
View Source
implicit operator (TItem item, string step)(ItemStepPair<TItem>)
Implicitly converts a ItemStepPair to an equivalent tuple.
Declaration
public static implicit operator (TItem item, string step)(ItemStepPair<TItem> pair)
Parameters
Returns
View Source
implicit operator ItemStepPair<TItem>((TItem item, string step))
Implicitly converts a tuple to its equivalent ItemStepPair.
Declaration
public static implicit operator ItemStepPair<TItem>((TItem item, string step) tuple)
Parameters
Returns
View Source
operator !=(ItemStepPair<TItem>, ItemStepPair<TItem>)
True if the given pairs have different components and/or tags; false otherwise.
Declaration
public static bool operator !=(ItemStepPair<TItem> left, ItemStepPair<TItem> right)
Parameters
Returns
Implements
Extension Methods