using System.Collections;
using System.Collections.Generic;
public class CardInfo : IEquatable<CardInfo>
public CardInfo(int number, int id)
public bool Equals(CardInfo other) => number == other.number && id == other.id;
public static void Main()
var arr = new List<CardInfo> { new(1, 2) };
var idx = arr.IndexOf(new CardInfo(1,2));