Show / Hide Table of Contents

Struct ItemStepPair<TItem>

An item added to a generation context component and the name of the step that added it.

Implements
IEquatable<ItemStepPair<TItem>>
IMatchable<ItemStepPair<TItem>>
Inherited Members
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: GoRogue.MapGeneration.ContextComponents
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)

Constructor.

Declaration
public ItemStepPair(TItem item, string step)
Parameters
Type Name Description
TItem item
string step

Fields

View Source

Item

The item.

Declaration
[DataMember]
public readonly TItem Item
Field Value
Type Description
TItem
View Source

Step

The name associated with the step that created the item.

Declaration
[DataMember]
public readonly string Step
Field Value
Type Description
string

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
Type Name Description
ItemStepPair<TItem> other
Returns
Type Description
bool
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
Type Description
bool
Overrides
ValueType.Equals(object)
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
Type Name Description
(TItem item, string step) tuple
Returns
Type Description
ItemStepPair<TItem>
View Source

GetHashCode()

Returns a hash code based on all of the pair's fields.

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
ValueType.GetHashCode()
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
Type Name Description
ItemStepPair<TItem> other
Returns
Type Description
bool
View Source

ToString()

Returns a string representing the item and the name of the step that added it.

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
ValueType.ToString()
View Source

ToTuple()

Converts the pair to an equivalent tuple.

Declaration
public (TItem item, string step) ToTuple()
Returns
Type Description
(TItem item, string step)

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
Type Name Description
ItemStepPair<TItem> left
ItemStepPair<TItem> right
Returns
Type Description
bool
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
Type Name Description
ItemStepPair<TItem> pair
Returns
Type Description
(TItem item, string step)
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
Type Name Description
(TItem item, string step) tuple
Returns
Type Description
ItemStepPair<TItem>
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
Type Name Description
ItemStepPair<TItem> left
ItemStepPair<TItem> right
Returns
Type Description
bool

Implements

IEquatable<T>
IMatchable<T>

Extension Methods

Utility.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX