static bool Check(List <Card> deck) { List <string> warns = new List <string>(), errors = new List <string>(); DeckIO.checkDeckStandart(deck, ref warns, ref errors); //ShowMessages(warns, errors); return(errors.Count == 0); }
public void Edit(Player editor, Deck editingDeck) { List <Card> allCards = DeckIO.invokeAllCards(); //foreach (Card c in allCards) // allCardsPreview.AddLog(c.ToString(), UtilsDrawing.please.getClosestFore(UtilsDrawing.colorOfRarity(c.rarity))); PlayerChoiseDialog.deckCreatingDialog(editingDeck.cards, allCards, deckPreview, allCardsPreview, previewContext, logger); }
public Deck Load(string fileName) { List <string> warns = new List <string>(), errors = new List <string>(); Deck loaded = DeckIO.readDeckFromFile(fileName, ref warns, ref errors); logger.AddLog(String.Format("Loaded deck \"{0}\".", fileName)); ShowMessages(warns, errors); return(Check(loaded.cards) ? loaded : null); }
public static bool Check(List <Card> deck, ConsoleWindowText window) { List <string> warns = new List <string>(), errors = new List <string>(); DeckIO.checkDeckStandart(deck, ref warns, ref errors); window.ClearLogWindow(); foreach (string w in warns) { window.AddLog("Warning: " + w, ConsoleColor.DarkYellow); } foreach (string e in errors) { window.AddLog("Error: " + e, ConsoleColor.Red); } return(errors.Count == 0); }