Esempio n. 1
0
        public void WpnRemove()
        {
            Console.WriteLine("Which would you like to take from the armory?");
            WpnsAvailable();
            Console.WriteLine();
            int selection = UserInput.GetIntegerResponse("Please select by entering it's ID number: ");

            WeaponsRepo.DeleteWeapon(selection);
            Console.WriteLine("You have successfully removed the weapon from the armory!");
            Console.WriteLine();
        }
Esempio n. 2
0
        public void WpnCreate()
        {
            Console.WriteLine("Congrats on finding a new weapon in the field!");
            Thread.Sleep(500);
            Console.WriteLine("Please wait while we prepare the Armory to receive your weapon...");
            Thread.Sleep(500);
            Console.WriteLine(".");
            Thread.Sleep(500);
            Console.WriteLine(".");
            Thread.Sleep(500);
            Console.WriteLine(".");
            Thread.Sleep(500);
            Console.WriteLine();
            Console.WriteLine("You may now add your weapon to the Armory...:");
            string name = UserInput.GetStringResponse("Please enter the name of the weapon: ");

            Console.WriteLine();
            int type = UserInput.GetIntegerResponse("Please enter the type of the weapon from the following list: \n 1. Sidearm \n 2. Hand Cannon \n 3. Submachine Gun \n 4. Scout Rifle \n 5. Pulse Rifle \n " +
                                                    "6. Auto Rifle \n 7. Trace Rifle \n 8. Fusion Rifle \n 9. Linear Fusion Rifle \n 10. Sniper Rifle \n 11. Shotgun \n 12. Grenade Launcher \n 13. Rocket Launcher \n " +
                                                    "14. Sword \n 15. Combat Bow");

            Console.WriteLine();
            int rarity = UserInput.GetIntegerResponse("Please enter the rarity of the weapon from the following list: \n 1. Common \n 2. Uncommon \n 3. Rare \n " +
                                                      "4. Legendary \n 5. Exotic");

            Console.WriteLine();
            string slot = UserInput.GetStringResponse("Please enter the slot your weapon goes in (Kinetic, Energy, or Power): ");

            Console.WriteLine();
            int attack = UserInput.GetIntegerResponse("Please enter your weapon's Attack level: ");

            Console.WriteLine();
            int impact = UserInput.GetIntegerResponse("Please enter your weapon's Impact rating: ");

            Console.WriteLine();
            int magazine = UserInput.GetIntegerResponse("Please enter your weaon's Magazine capacity: ");

            Console.WriteLine();

            var newWeapon = new Weapons {
                WeaponName = name, WeaponType = type, Rarity = rarity, Slot = slot, Attack = attack, Impact = impact, Magazine = magazine
            };

            WeaponsRepo.CreateWeapon(newWeapon);
            Console.WriteLine("Your weapon has been added to the armory!");
            Console.WriteLine();
        }
Esempio n. 3
0
        public void WpnUpdate()
        {
            Console.WriteLine("Which weapon would you like to update?");
            WpnsAvailable();
            Console.WriteLine();
            int selection = UserInput.GetIntegerResponse("Please enter the ID number of the weapon you want to update: ");

            Console.WriteLine("Please enter the following information for the weapon selected: ");
            string name     = UserInput.GetStringResponse("Please enter the name of the weapon: ");
            int    type     = UserInput.GetIntegerResponse("Please enter the type of the weapon: ");
            int    rarity   = UserInput.GetIntegerResponse("Please enter the rarity of the weapon: ");
            string slot     = UserInput.GetStringResponse("Please enter the slot your weapon goes in: ");
            int    attack   = UserInput.GetIntegerResponse("Please enter your weapon's Attack level: ");
            int    impact   = UserInput.GetIntegerResponse("Please enter your weapon's Impact rating: ");
            int    magazine = UserInput.GetIntegerResponse("Please enter your weaon's Magazine capacity: ");

            WeaponsRepo.UpdateWeapon(name, type, rarity, slot, attack, impact, magazine, selection);
            Console.WriteLine("The weapon was successfully updated!");
        }
Esempio n. 4
0
        public static void Main(string[] args)
        {
            while (true)
            {
                IConfigurationRoot configuration = new ConfigurationBuilder()
                                                   .SetBasePath(Directory.GetCurrentDirectory())
                                                   .AddJsonFile("appsettings.json")
#if DEBUG
                                                   .AddJsonFile("appsettings.DEBUG.json")
#else
                                                   .AddJsonFile("appsettings.Release.json")
#endif
                                                   .Build();

                string connString = configuration.GetConnectionString("DefaultConnection");

                var weaponsRepo = new WeaponsRepository(connString);



                Console.WriteLine("Welcome to the Destiny 2 Armory!");
                Console.WriteLine(" ");

                var weaponsOne = new MenuOps(weaponsRepo);

                weaponsOne.MainMenu();

                int selection = UserInput.GetIntegerResponse("Please enter the number for your selection: ");

                if (selection == 1)
                {
                    weaponsOne.WpnsAvailable();
                }
                else if (selection == 2)
                {
                    weaponsOne.WpnCreate();
                }
                else if (selection == 3)
                {
                    weaponsOne.WpnUpdate();
                }
                else if (selection == 4)
                {
                    weaponsOne.WpnRemove();
                }
                else if (selection == 5)
                {
                    Console.WriteLine("Thank you for visiting!");

                    Console.WriteLine("Good Bye!");
                    break;
                }
                else
                {
                    UserInput.GetIntegerResponse("Please enter a selection fom the menu options: ");
                }

                Console.WriteLine();
                Console.WriteLine("Press any key to return to the Main Menu!");
                Console.ReadLine();
            }
        }