Example #1
0
        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);
        }
Example #2
0
 public static Task <List <byte[]> > GetResponseCardsAsync(string deckCode) => ResponseCardsCache.GetItemAsync(deckCode);
Example #3
0
 public static Task <List <byte[]> > GetCallCardsAsync(string deckCode) => CallCardsCache.GetItemAsync(deckCode);