示例#1
0
        public InventoryMenu(IEnumerable <InventoryItem> items)
        {
            Blocks = new List <BlockMessage>
            {
                BlockMessage.Divider()
            };

            Blocks.AddRange(items.Aggregate(new List <BlockMessage>(), (list, item) => list.Concat(ItemSection(item)).ToList()));
        }
示例#2
0
        public ShopMenu(IEnumerable <Item> items)
        {
            Blocks = new List <BlockMessage>
            {
                BlockMessage.TextSection(DougMessages.ShopSpeech),
                BlockMessage.Divider()
            };

            Blocks.AddRange(items.Select(ShopItemSection));
            Blocks.Add(BlockMessage.Divider());
        }
示例#3
0
        private static List <BlockMessage> ItemSection(InventoryItem item)
        {
            var blocks = new List <BlockMessage>();

            var textBlock   = TextBlock.MarkdownTextBlock($"{item.Item.Icon} *{item.Item.Name}* \n {item.Item.Description}");
            var itemOptions = ItemActionsAccessory(item.InventoryPosition, item.Item.Price / 2);

            blocks.Add(new BlockMessage {
                Type = "section", Text = textBlock, Accessory = itemOptions
            });
            blocks.Add(BlockMessage.Context(string.Format(DougMessages.Quantity, item.Quantity)));
            blocks.Add(BlockMessage.Divider());

            return(blocks);
        }