Show / Hide Table of Contents

Struct ComponentTypeTagPair

A type of a component and the tag expected to be associated with a component of that type in a IComponentCollection or map generation step.

Implements
IEquatable<ComponentTypeTagPair>
IMatchable<ComponentTypeTagPair>
Inherited Members
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: GoRogue.Components
Assembly: GoRogue.dll
Syntax
[DataContract]
public readonly struct ComponentTypeTagPair : IEquatable<ComponentTypeTagPair>, IMatchable<ComponentTypeTagPair>

Constructors

View Source

ComponentTypeTagPair(Type, string?)

Constructor.

Declaration
public ComponentTypeTagPair(Type componentType, string? tag)
Parameters
Type Name Description
Type componentType
string tag

Fields

View Source

ComponentType

The type of component expected.

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

Tag

The tag expected to be associated with a component of the specified type.

Declaration
[DataMember]
public readonly string? Tag
Field Value
Type Description
string

Methods

View Source

Deconstruct(out Type, out string?)

Supports C# Deconstruction syntax.

Declaration
public void Deconstruct(out Type componentType, out string? tag)
Parameters
Type Name Description
Type componentType
string tag
View Source

Equals(ComponentTypeTagPair)

True if the given pair has the same component type and tag; false otherwise.

Declaration
public bool Equals(ComponentTypeTagPair other)
Parameters
Type Name Description
ComponentTypeTagPair other
Returns
Type Description
bool
View Source

Equals(object?)

True if the given object is a ComponentTypeTagPair and has the same component type and tag; 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((Type componentType, string? tag))

Converts the tuple to an equivalent ComponentTypeTagPair.

Declaration
public static ComponentTypeTagPair FromTuple((Type componentType, string? tag) tuple)
Parameters
Type Name Description
(Type componentType, string tag) tuple
Returns
Type Description
ComponentTypeTagPair
View Source

GetHashCode()

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

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
ValueType.GetHashCode()
View Source

Matches(ComponentTypeTagPair)

True if the given pair has the same component type and tag; false otherwise.

Declaration
public bool Matches(ComponentTypeTagPair other)
Parameters
Type Name Description
ComponentTypeTagPair other
Returns
Type Description
bool
View Source

ToString()

Returns a string representing the component type and its tag.

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

ToTuple()

Converts the pair to an equivalent tuple.

Declaration
public (Type componentType, string? tag) ToTuple()
Returns
Type Description
(Type componentType, string tag)

Operators

View Source

operator ==(ComponentTypeTagPair, ComponentTypeTagPair)

True if the given pairs have the same component type and tag; false otherwise.

Declaration
public static bool operator ==(ComponentTypeTagPair left, ComponentTypeTagPair right)
Parameters
Type Name Description
ComponentTypeTagPair left
ComponentTypeTagPair right
Returns
Type Description
bool
View Source

implicit operator (Type componentType, string? tag)(ComponentTypeTagPair)

Implicitly converts a ComponentTypeTagPair to an equivalent tuple.

Declaration
public static implicit operator (Type componentType, string? tag)(ComponentTypeTagPair pair)
Parameters
Type Name Description
ComponentTypeTagPair pair
Returns
Type Description
(Type componentType, string tag)
View Source

implicit operator ComponentTypeTagPair((Type componentType, string? tag))

Implicitly converts a tuple to its equivalent ComponentTypeTagPair.

Declaration
public static implicit operator ComponentTypeTagPair((Type componentType, string? tag) tuple)
Parameters
Type Name Description
(Type componentType, string tag) tuple
Returns
Type Description
ComponentTypeTagPair
View Source

operator !=(ComponentTypeTagPair, ComponentTypeTagPair)

True if the given pairs have different component types and/or tags; false otherwise.

Declaration
public static bool operator !=(ComponentTypeTagPair left, ComponentTypeTagPair right)
Parameters
Type Name Description
ComponentTypeTagPair left
ComponentTypeTagPair 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