public static void InDoors(ICharacters character) { if (CityMap.PositionX == 20 && CityMap.PositionY == 19) { BuildingMessages.BuldingMessage("Arena"); Arena.FightInArena(character, OnInputWork.ChoiceHandler()); } else if (CityMap.PositionX == 26 && CityMap.PositionY == 11) { BuildingMessages.BuldingMessage("WeaponSmith"); Console.WriteLine("You have: " + character.Money + " money, " + character.Strength + " Strength!"); List <CreatingItems> buildingitems = new List <CreatingItems>(); buildingitems = ProductsInBuldings.GetWeaponsAvailable(character); Console.WriteLine(ProductsInBuldings.ShowProductsAvailable(buildingitems, "Strength")); WeaponShop.Weapon(character, buildingitems, OnInputWork.ChoiceHandler()); } else if (CityMap.PositionX == 30 && CityMap.PositionY == 7) { BuildingMessages.BuldingMessage("ArmorSmith"); Console.WriteLine("You have: " + character.Money + " money, " + character.Durability + " Durability!"); List <CreatingItems> buildingitems = new List <CreatingItems>(); buildingitems = ProductsInBuldings.GetArmorAvailable(character); Console.WriteLine(ProductsInBuldings.ShowProductsAvailable(buildingitems, "Durability")); ArmorSmith.Armor(character, buildingitems, OnInputWork.ChoiceHandler()); } else if (CityMap.PositionX == 16 && CityMap.PositionY == 4) { BuildingMessages.BuldingMessage("Shop"); Console.WriteLine("You have: " + character.Money + " money, " + character.Alchemics + " Alchemics!"); List <CreatingItems> buildingitems = new List <CreatingItems>(); buildingitems = ProductsInBuldings.GetShopAvailable(character); Console.WriteLine(ProductsInBuldings.ShowProductsAvailable(buildingitems, "Alchemics")); ItemShop.Item(character, buildingitems, OnInputWork.ChoiceHandler()); } }
static public void Run() { Console.WriteLine("------------FactoryMethod------------"); Smith smith = new ArmorSmith(); Item item = smith.Create(); item.Equip(); smith = new WeaponSmith(); item = smith.Create(); item.Equip(); }
static void Main(string[] args) { #region Strategy //Hero heroAxe = new Hero(new Axe(damage: 90)); //Hero heroBlade = new Hero(new Blade(damage: 95)); //int monsterDef = 75; //Console.WriteLine($"Axe: {heroAxe.Attack(monsterDef)}"); //Console.WriteLine($"Axe: {heroBlade.Attack(monsterDef)}"); #endregion #region Factory Method //Necromancer necromancer = new Necromancer(); //Undead undead = necromancer.RaiseUndead<Sceleton>(); #endregion #region TamplateMethod ArmorSmith aSmith = new ArmorSmith(); WeaponSmith wSmith = new WeaponSmith(); aSmith.ForgeGear(); Console.WriteLine("Armor Ready!!!\n"); wSmith.ForgeGear(); Console.WriteLine("Weapon Ready!!!\n"); #endregion #region Builder //string player = "Me"; //string target = "Foe"; //string world = "sand"; //SpellDirector lol = new SpellDirector(); //SpellBuffBuilder builder = new SpellBuffBuilder(player, target, world); //lol.Builder = builder; //lol.BuildSpell(); //builder.GetSpell(); #endregion #region Abstract Factory AbstractFactory statsFactory = new StatsFactory(); IncreasePotions potion = statsFactory.GetIncreasePotion(); Console.WriteLine(potion.Effect); #endregion #region Singleton Team team = Team.GetTeam(); team.AddMember(new TeamMember()); #endregion Console.ReadLine(); }