Exemplo n.º 1
0
        void ShopListArmors()
        {
            var count = 1;

            Console.WriteLine("---Armors For Sale---");
            foreach (var armor in ArmorsList.OrderBy(x => x.Name))
            {
                Console.WriteLine($"a{count} {armor.Name}, {armor.OriginalValue}, {armor.ResellValue}");
                ItemCatalog.Add($"a{count}", armor);
                count++;
            }
            Console.WriteLine("");
        }
Exemplo n.º 2
0
        void ShopListPotions()
        {
            var count = 1;

            Console.WriteLine("---Potions For Sale---");
            foreach (var potion in PotionsList.OrderBy(x => x.Name))
            {
                Console.WriteLine($"p{count} {potion.Name}, {potion.OriginalValue}, {potion.ResellValue}");
                ItemCatalog.Add($"p{count}", potion);
                count++;
            }
            Console.WriteLine("");
        }
Exemplo n.º 3
0
        void ShopListWeapons()
        {
            var count = 1;

            Console.WriteLine("---Weapons For Sale---");
            foreach (var weapon in WeaponsList.OrderBy(x => x.Name))
            {
                Console.WriteLine($"w{count} {weapon.Name}, {weapon.OriginalValue}, {weapon.ResellValue}");
                ItemCatalog.Add($"w{count}", weapon);
                count++;
            }
            Console.WriteLine("");
        }
Exemplo n.º 4
0
        public void ListPotions()
        {
            Console.WriteLine("Potions:");
            var count = 1;

            foreach (var potion in PotionsList.OrderBy(p => p.OriginalValue))
            {
                Console.WriteLine($"p{count}. {potion.Name} - Original Value: {potion.OriginalValue}, Resell Value: {potion.ResellValue}");
                ItemCatalog.Add($"p{count}", potion);
                count++;
            }
            Console.WriteLine();
        }
Exemplo n.º 5
0
        public void ListArmors()
        {
            Console.WriteLine("Armors:");
            var count = 1;

            foreach (var armor in ArmorList.OrderBy(a => a.OriginalValue))
            {
                Console.WriteLine($"a{count}. {armor.Name} - Original Value: {armor.OriginalValue}, Resell Value: {armor.ResellValue}");
                ItemCatalog.Add($"a{count}", armor);
                count++;
            }
            Console.WriteLine();
        }
Exemplo n.º 6
0
        public void ListWeapons()
        {
            Console.WriteLine("Weapons:");
            var count = 1;

            foreach (var weapon in WeaponsList.OrderBy(w => w.OriginalValue))
            {
                Console.WriteLine($"w{count}. {weapon.Name} - Original Value: {weapon.OriginalValue}, Resell Value: {weapon.ResellValue}");
                ItemCatalog.Add($"w{count}", weapon);
                count++;
            }
            Console.WriteLine();
        }
Exemplo n.º 7
0
        public async Task <IActionResult> Create([FromBody] SaveItemJson json)
        {
            var catalog = new ItemCatalog(_dbContext, _messageBroker);

            var item = json.MapTo(new Item
            {
                TenantId = User.Claims.TenantId()
            });

            await catalog.Add(item);

            if (catalog.GroupNotExists)
            {
                return(new ItemGroupNotFoundError());
            }

            return(new ItemJson(catalog.Item));
        }