Advertisement
2629881

Untitled

Jul 30th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.32 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace inventory
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Inventory inventory = new Inventory();
  14.             Console.WriteLine("Wpisz komende /add /switch /display");
  15.             // test
  16.             inventory.DisplayItems();
  17.             Console.WriteLine();
  18.             // test
  19.  
  20.  
  21.  
  22.             while (true)
  23.             {
  24.                 string command = Console.ReadLine();
  25.                 switch (command)
  26.                 {
  27.                     case "/display":
  28.                         {
  29.                             inventory.DisplayItems();
  30.                             Console.WriteLine();
  31.                         }
  32.                         break;
  33.                     case "/add":
  34.                         {
  35.                             string item = Console.ReadLine(); ;
  36.                             inventory.AddItem(item);
  37.                             Console.WriteLine("{0} has been added to your inventory", item);
  38.                             inventory.DisplayItems();
  39.                         }
  40.                         break;
  41.                     case "/switch":
  42.                         break;
  43.                 }
  44.             }
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement