Files
ParkingRobot/ClumsyPilot/ParkrobTrajplanner/Utils/GridIndex.cs
T

16 lines
713 B
C#

using System;
namespace MultiWheelC.TrajectoryPlanning.Utils;
public readonly struct GridIndex : IEquatable<GridIndex>
{
public GridIndex(int row, int col) { Row = row; Col = col; }
public int Row { get; }
public int Col { get; }
public bool Equals(GridIndex other) { return Row == other.Row && Col == other.Col; }
public override bool Equals(object obj) { return obj is GridIndex && Equals((GridIndex)obj); }
public override int GetHashCode() { unchecked { return Row * 397 ^ Col; } }
public static bool operator ==(GridIndex left, GridIndex right) { return left.Equals(right); }
public static bool operator !=(GridIndex left, GridIndex right) { return !left.Equals(right); }
}