public void Save() { GoogleSheets.SaveChanges(AllKnownDecks.Where(x => x.IsDirty).ToArray()); GoogleSheets.SaveChanges(AllKnownCards.Where(x => x.IsDirty).ToArray()); GoogleSheets.SaveChanges(AllKnownFields.Where(x => x.IsDirty).ToArray()); GoogleSheets.SaveChanges(AllKnownLayerTextOptions.Where(x => x.IsDirty).ToArray()); ClearIsDirty(); }
public Deck AddDeck() { Deck deck = new Deck(); deck.CreateNewId(); deck.Name = $"Deck {++numDecksCreated}"; AllKnownDecks.Add(deck); return(deck); }
Deck GetParentDeck(Card card) { Deck parentDeck = AllKnownDecks.FirstOrDefault(x => x.ID == card.DeckId); if (parentDeck == null) { parentDeck = new Deck(); parentDeck.CreateNewId(); parentDeck.Name = card.DeckId; AllKnownDecks.Add(parentDeck); } return(parentDeck); }
public void Delete(Deck deck) { GoogleSheets.DeleteRow(deck); AllKnownDecks.Remove(deck); }