示例#1
0
        public void CreateNewHero()
        {
            Console.WriteLine("Input name for your hero: ");
            string name = Console.ReadLine();

            HeroModel newHero = new HeroModel()
            {
                Name = name, HealthPoints = 15, Current_healthpoints = 15, Vit = 1, Dex = 1, Str = 1, Acc = 1, Exp = 0, Char_level = 1, Money = 20, Current_place = 1
            };

            heroBusiness.Add(newHero);

            HeroModel heroModification = heroBusiness.Get(newHero.Id);

            equipmentBusiness.Add(new Equipment()
            {
                Name = "Wooden sword", Is_equiped = true, Owner_id = heroModification.Id, Points = 1, Price = 10, Type = "Weapon"
            });
            equipmentBusiness.Add(new Equipment()
            {
                Name = "Leather armor", Is_equiped = true, Owner_id = heroModification.Id, Points = 1, Price = 10, Type = "Armor"
            });

            List <Equipment> heroBeginingItems = equipmentBusiness.GetAllByOwnerId(heroModification.Id).ToList();

            heroModification.Equiped_weapon_id = heroBeginingItems[0].Id;
            heroModification.Equiped_Armor_id  = heroBeginingItems[1].Id;

            heroBusiness.Update(heroModification);
        }
示例#2
0
        public void showPlaceInfo()
        {
            string placeCommand = place.showPlaceInformation();

            if (placeCommand == "s" && place.Shop == true)
            {
                Shop shop = new Shop();
                hero = shop.showShopItems(hero);
            }
            else if (placeCommand == "b" && place.Bed == true)
            {
                Bed bed = new Bed();
                hero = bed.useBed(hero);
            }
            else if (placeCommand == "a" && place.Arena == true)
            {
                EnemyArena enemyArena = new EnemyArena();
                hero = enemyArena.pickEnemyToFight(hero);
            }
            else if (placeCommand == "f" && place.Forge == true)
            {
                Forge forge = new Forge();
                hero = forge.showForgeOptions(hero);
            }
            else if (placeCommand == "n" && place.NextPlace != null)
            {
                place        = place.goToNextPlace();
                hero.PlaceId = place.Id;
                heroBusiness.Update(hero);
            }
            else if (placeCommand == "p" && place.PrevPlace != null)
            {
                place        = place.goToPrevPlace();
                hero.PlaceId = place.Id;
                heroBusiness.Update(hero);
            }
        }