Exemple #1
0
        public override void Start()
        {
            _factory = FindObjectOfType(typeof(HealerFactory)) as HealerFactory;
            if (_factory == null)
            {
                return;
            }

            base.Factory = this._factory;
            base.Start();
        }
Exemple #2
0
 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;
 }
Exemple #3
0
        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();
        }
Exemple #4
0
 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 }
     };
 }