Show / Hide Table of Contents

Struct GoalMapWeightPair

A goal map paired with a weight, designed to be used with WeightedGoalMap.

Implements
IEquatable<GoalMapWeightPair>
IMatchable<GoalMapWeightPair>
Inherited Members
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: GoRogue.Pathing
Assembly: GoRogue.dll
Syntax
public readonly struct GoalMapWeightPair : IEquatable<GoalMapWeightPair>, IMatchable<GoalMapWeightPair>

Constructors

View Source

GoalMapWeightPair(IGridView<double?>, double)

Constructor.

Declaration
public GoalMapWeightPair(IGridView<double?> goalMap, double weight)
Parameters
Type Name Description
IGridView<double?> goalMap

The goal map.

double weight

Weight for the specified goal map.

Fields

View Source

GoalMap

The goal map.

Declaration
public readonly IGridView<double?> GoalMap
Field Value
Type Description
IGridView<double?>
View Source

Weight

The weight of the specified goal map.

Declaration
public readonly double Weight
Field Value
Type Description
double

Methods

View Source

Deconstruct(out IGridView<double?>, out double)

Supports C# Deconstruction syntax.

Declaration
public void Deconstruct(out IGridView<double?> goalMap, out double weight)
Parameters
Type Name Description
IGridView<double?> goalMap
double weight
View Source

Equals(GoalMapWeightPair)

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

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

Equals(object?)

True if the given object is a GoalMapWeightPair and has the same goal map and weight; 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((IGridView<double?> goalMap, double weight))

Converts the tuple to an equivalent ComponentTypeTagPair.

Declaration
public static GoalMapWeightPair FromTuple((IGridView<double?> goalMap, double weight) tuple)
Parameters
Type Name Description
(IGridView<double?> goalMap, double weight) tuple
Returns
Type Description
GoalMapWeightPair
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(GoalMapWeightPair)

True if the given pair has the same goal map and weight; false otherwise.

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

ToTuple()

Converts the pair to an equivalent tuple.

Declaration
public (IGridView<double?> goalMap, double weight) ToTuple()
Returns
Type Description
(IGridView<double?> goalMap, double weight)

Operators

View Source

operator ==(GoalMapWeightPair, GoalMapWeightPair)

True if the given pairs have the same goal map and weight; false otherwise.

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

implicit operator (IGridView<double?> goalMap, double weight)(GoalMapWeightPair)

Implicitly converts a GoalMapWeightPair to an equivalent tuple.

Declaration
public static implicit operator (IGridView<double?> goalMap, double weight)(GoalMapWeightPair pair)
Parameters
Type Name Description
GoalMapWeightPair pair
Returns
Type Description
(IGridView<double?> goalMap, double weight)
View Source

implicit operator GoalMapWeightPair((IGridView<double?> goalMap, double weight))

Implicitly converts a tuple to its equivalent GoalMapWeightPair.

Declaration
public static implicit operator GoalMapWeightPair((IGridView<double?> goalMap, double weight) tuple)
Parameters
Type Name Description
(IGridView<double?> goalMap, double weight) tuple
Returns
Type Description
GoalMapWeightPair
View Source

operator !=(GoalMapWeightPair, GoalMapWeightPair)

True if the given pairs have different goal maps and/or weights; false otherwise.

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