public static List<CardData> cardDataList = new List<CardData>();
public class CardData
{
public string cardType { get; set; }
public int cardColor { get; set; }
}
static void Main(string[] args){
Console.WriteLine(this.cardDataList.FirstOrDefault().CardType);
}
// another function should be called before the printing
public void MyAddFunction()
{
cardDataList.Add(new CardData() { cardType = boxLine1, cardColor = randColor });
}