private static async Task <List <byte[]> > CreateCallCards(string deckCode) { var deck = await DeckCache.GetItemAsync(deckCode); var cardSheets = RenderService.RenderCardSheets(deck.Cards.Calls, deckCode, Color.Black, Color.White); var sheetBuffers = new List <byte[]>(); Debug.WriteLine($"Creating call cards for deck {deckCode}"); foreach (var sheet in cardSheets) { await using var sheetStream = new MemoryStream(); sheet.Save(sheetStream, ImageFormat.Png); sheetBuffers.Add(sheetStream.ToArray()); } return(sheetBuffers); }
public static Task <List <byte[]> > GetResponseCardsAsync(string deckCode) => ResponseCardsCache.GetItemAsync(deckCode);
public static Task <List <byte[]> > GetCallCardsAsync(string deckCode) => CallCardsCache.GetItemAsync(deckCode);