using System.Collections.Generic;
public static class Program
public static void Main()
var moves = new List<Move>
if (moves.Contains(new Move(1, 2)))
Console.WriteLine("Contained");
if (moves.Contains(new Move(2, 1)))
Console.WriteLine("Contained");
public Move(int p1, int p2)
public int position1 { get; private set; }
public int position2 { get; private set; }
public override bool Equals(object obj)
if (ReferenceEquals(this, obj))
Move other = obj as Move;
return (position1 == other.position1 && position2 == other.position2) ||
(position1 == other.position2 && position2 == other.position1);
public override int GetHashCode()
return position1 + position2;