Пример #1
0
 protected Base()
 {
     Subject = new PotionFactory(
         EffectIngredientPriorityFactory.Object,
         AlchemyFormulae.Object,
         AlchemyEffectFactory.Object);
 }
Пример #2
0
 private void PrintPotions()
 {
     while (AttackGears.Count < numberOfAttackGears)
     {
         Potions.Add(PotionFactory.MakePotion(5)); continue;
     }
 }
Пример #3
0
 public StandardRoom()
 {
     WasVisited = false;
     HasPillar  = false;
     Potion     = PotionFactory.MakeRandomPotion();
     Trap       = TrapFactory.MakeRandomTrap();
     Enemy      = MonsterFactory.MakeRandomMonster();
 }
Пример #4
0
        public void HealthPotionObject_ShouldIncreaseHealth_WhenUsed()
        {
            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.HealthCurr = 50;
            IUseable <Item> potion = PotionFactory.CreateHealthPotion("test", 1, 50);

            dummy.Use(potion);

            Assert.AreEqual(dummy.HealthCurr, 100);
        }
Пример #5
0
        public void Arrange()
        {
            var container = AutoMock.GetLoose();

            _registry      = container.Mock <ICreatureRegistry>();
            _resolver      = container.Create <ConsumeResolver>();
            _potionFactory = new PotionFactory();
            var maxHitpoints = 12;
            var playerId     = "arbitraryId";

            _player = CreatePlayer(playerId, maxHitpoints);
        }
Пример #6
0
        public void UseMethod_ShouldUseItem_WhenCalled()
        {
            IWarriorHero dummy = ClassFactory.CreateWarrior("test");

            dummy.HealthCurr = 1;
            double          oldHealthCurr = dummy.HealthCurr;
            IUseable <Item> healthPotion  = PotionFactory.CreateHealthPotion("test", 1, 50);

            dummy.Use(healthPotion);

            Assert.AreNotEqual(oldHealthCurr, dummy.HealthCurr);
        }
Пример #7
0
    //------------------------------------------------------------------------------------------------------------------------
    //                                                  PopulateList()
    //------------------------------------------------------------------------------------------------------------------------
    private void PopulateList(int pWeaponCount, int pArmorCount, int pPotionCount)
    {
        WeaponFactory weaponFactory = new WeaponFactory();
        ArmorFactory armorFactory = new ArmorFactory();
        PotionFactory potionFactory = new PotionFactory();

        GenerateItems(pWeaponCount, _itemList, weaponFactory);
        GenerateItems(pArmorCount, _itemList, armorFactory);
        GenerateItems(pPotionCount, _itemList, potionFactory);

        //Give each item an unique index.
        int itemIndex = 0;
        foreach (Item item in _itemList)
        {
            item.ItemIndex = itemIndex;
            itemIndex++;
        }
    }
Пример #8
0
    public void Brew()
    {
        float             holder;
        potionRequrements requrements = new potionRequrements();

        //set the new requrements that will be passed int the factory to the current local values
        requrements.ratTail   = ratTail;
        requrements.owlEye    = owlEye;
        requrements.lylack    = lylack;
        requrements.sunflower = sunflower;
        requrements.silver    = silver;
        requrements.gold      = gold;

        IPotion potion = new BasicPotion();

        PotionFactory factory = new PotionFactory();

        potion = factory.Create(requrements);

        holder = potion.Create();

        CostText.text = holder.ToString();
    }
Пример #9
0
    private void Awake()
    {
        if (!instance)
        {
            travel    = null;
            mapBounds = new Pair(-11.29f + 0.3f, 9.15f - 0.3f);
            ts        = new Dictionary <int, Pair>(2)
            {
                { 1, new Pair(0, 0) }, { 2, new Pair(0, 2) }
            };
            attackTypeFactory = new AttackTypeFactory();
            weaponFactory     = new WeaponFactory();
            potionFactory     = new PotionFactory();
            armorFactory      = new ArmorFactory();
            skillTypeFactory  = new SkillTypeFactory();
            instance          = this;
        }
        else if (instance != this)
        {
            Destroy(this.gameObject);
        }

        DontDestroyOnLoad(this.gameObject);
    }
Пример #10
0
 public PotionSpellFactory(SpellFactoryInitializer initializer, PotionFactory potionFactory, IReadOnlyList <PotionFactory> potionFactories) : base(initializer)
 {
     PotionFactory   = potionFactory;
     PotionFactories = potionFactories;
 }
Пример #11
0
 public void Initialize()
 {
     miscItemFactory = new MiscItemFactory();
     weaponFactory   = new WeaponFactory();
     potionFactory   = new PotionFactory();
 }