public override void Start() { _factory = FindObjectOfType(typeof(HealerFactory)) as HealerFactory; if (_factory == null) { return; } base.Factory = this._factory; base.Start(); }
public Bot(IOutput output, MonsterFactory monsterFactory, HealerFactory healerFactory, WeaponDealerFactory weaponDealerFactory, ClothesDealerFactory clothesDealerFactory, PersonageSettings settings) : base(output) { _monsterFactory = monsterFactory; _healerFactory = healerFactory; _weaponDealerFactory = weaponDealerFactory; _clothesDealerFactory = clothesDealerFactory; _settings = settings; }
public static void Main() { PlayerFactory archerFactory = new ArcherFactory(); var archerClient = new Client(archerFactory); archerClient.Run(); PlayerFactory healerFactory = new HealerFactory(); var healerClient = new Client(healerFactory); healerClient.Run(); Console.ReadKey(); }
public Game(MonsterFactory monsterFactory, HealerFactory healerFactory, WeaponDealerFactory weaponDealerFactory, ClothesDealerFactory clothesDealerFactory, BotFactory botFactory, Gamer gamer) { _gamer = gamer; _actions = new Dictionary <ConsoleKey, Func <Personage> > { { ConsoleKey.W, monsterFactory.GetPersonage }, { ConsoleKey.S, healerFactory.GetPersonage }, { ConsoleKey.A, weaponDealerFactory.GetPersonage }, { ConsoleKey.D, clothesDealerFactory.GetPersonage }, { ConsoleKey.E, botFactory.GetPersonage } }; }