public YgoSet Clone() { YgoSet newSet = new YgoSet(); newSet.Version = this.Version; newSet.Name = this.Name; newSet.Prefix = this.Prefix; newSet.Type = this.Type; foreach (YgoCard card in this.Cards) { newSet.Cards.Add(card.Clone()); } return(newSet); }
/// <summary> /// Save the set data to "fileName" path (with extension) /// </summary> /// <param name="card"></param> /// <param name="fileName"></param> public static void SaveTo(this YgoSet set, string fileName) { string data = JsonConvert.SerializeObject(set, Formatting.Indented); File.WriteAllText(fileName, data); }