Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace WeaponsFactory.Core
- {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using WeaponsFactory.Factories;
- public class Engine : IEngine
- {
- private WeaponFactory weaponFactory;
- public Engine()
- {
- this.weaponFactory = new WeaponFactory();
- }
- public void Run()
- {
- var input = Console.ReadLine()
- .Split(" ", StringSplitOptions.RemoveEmptyEntries).ToArray();
- var weapon = this.weaponFactory.CreateWeapon(input[0]);
- var result = weapon.InflictDamage(int.Parse(input[1]));
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement