示例#1
0
 public void gameStart()
 {
     Welcome();
     hero = createHero(name);
     Monster.addMonsters();
     WepaonsInicialization.addWeaponsList();
     ArmorInicialization.addArmorList();
     PotionsInicialization.addPotionsList();
     while (true)
     {
         Menu.mainMenuDecision(hero);
     }
 }
示例#2
0
        static public void shopMenuDecision(Hero hero)
        {
            List <string> menuItems = new List <string>()
            {
                "Weapons",
                "Armor",
                "Potions",
                "Exit"
            };

            Console.CursorVisible = false;
            while (true)
            {
                string selectedMenuItem = Menu.drawMenu(menuItems);
                if (selectedMenuItem == "Weapons")
                {
                    Console.Clear();
                    Console.WriteLine("Weapons");
                    WepaonsInicialization.showWeaponsList();
                    Shop.chooseItemToBuy("Weapons", hero);
                    Shop.buy(choosenItem, hero);
                }
                else if (selectedMenuItem == "Armor")
                {
                    Console.Clear();
                    Console.WriteLine("Armor");
                    ArmorInicialization.showArmorList();
                    Shop.chooseItemToBuy("Armor", hero);
                    Shop.buy(choosenItem, hero);
                }
                else if (selectedMenuItem == "Potions")
                {
                    Console.Clear();
                    Console.WriteLine("Potions");
                    PotionsInicialization.showPotionsList();
                    Shop.chooseItemToBuy("Potions", hero);
                    Shop.buy(choosenItem, hero);
                }
                else if (selectedMenuItem == "Exit")
                {
                    Menu.drawMenu(menuItems);
                    Menu.mainMenuDecision(hero);
                }
            }
        }
示例#3
0
        public static void Load(Hero hero)
        {
            string jsonString;
            string jsonFile = AppDomain.CurrentDomain.BaseDirectory + @"\" + "HeroAdvJson.txt";

            jsonString    = File.ReadAllText(jsonFile);
            saveCharacter = JsonConvert.DeserializeObject <jsonObject>(jsonString);
            SaveLoad.loadHeroStats(saveCharacter, hero);

            Monster.addMonsters();
            WepaonsInicialization.addWeaponsList();
            ArmorInicialization.addArmorList();
            PotionsInicialization.addPotionsList();
            while (true)
            {
                Menu.mainMenuDecision(hero);
            }
        }