Exemplo n.º 1
0
    Personage CreatePersonage(PersonageType type, int position)
    {
        Personage personage = PersonageFactory.Create(type);

        personage.transform.parent = transform;

        return(personage);
    }
Exemplo n.º 2
0
        public override void Action(Gamer gamer)
        {
            Output.Print("Bot action");
            PersonageFactory factory = null;

            if (gamer.Healts > 70 && gamer.Power < 6 && gamer.Money >= _settings.WeaponDealerSettings.Price)
            {
                factory = _weaponDealerFactory;
            }
            else if (gamer.Healts < 40 && gamer.Money > _settings.HealerSettings.Price)
            {
                factory = _healerFactory;
            }
            else if (gamer.Healts < 40 && gamer.Money > _settings.ClothesDealerSettings.Price)
            {
                factory = _clothesDealerFactory;
            }
            else
            {
                factory = _monsterFactory;
            }
            factory.GetPersonage().Action(gamer);
        }