Ejemplo n.º 1
0
        public Item CreatePotion(int pMaxAmount)
        {
            var amount             = Globals.random.Next(1, pMaxAmount + 1); // Random.Next(inclusive min, exclusive max)
            var type               = HUtils.RandomEnumValue <EEffect>(Globals.random);
            var potion             = new Item($"Potion of {type}", "potion", amount);
            var drinkableComponent = new Drinkable(type, 10);

            potion.AddComponent(drinkableComponent);

            return(potion);
        }
Ejemplo n.º 2
0
        public Item CreateWeapon(int pMaxAmount)
        {
            var amount = Globals.random.Next(1, pMaxAmount + 1); // Random.Next(inclusive min, exclusive max)
            var type   = HUtils.RandomEnumValue <EWeapon>(Globals.random);
            var weapon = new Item($"{type}", "dagger", amount);
            var attackableComponent = new Attackable(type, 5);

            weapon.AddComponent(attackableComponent);

            var equipableComponent = new Equipable(null, EItemSlot.LeftHand, 100);

            weapon.AddComponent(equipableComponent);

            return(weapon);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Returns HashCode of the range.
 /// </summary>
 public override int GetHashCode()
 {
     return(HUtils.GetHashCode(min, max));
 }
Ejemplo n.º 4
0
 public virtual IPrototype Clone()
 {
     return(new Item(name, iconName, Amount, HUtils.DeepCopyList(_components)));
 }
Ejemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 public override int GetHashCode()
 {
     return(HUtils.GetHashCode(x, y));
 }
Ejemplo n.º 6
0
 //------------------------------------------------------------------------------------------------------------------------
 //                                                  GetItems()
 //------------------------------------------------------------------------------------------------------------------------
 //returns a deepcopied list with all current items in the shop.
 public List <Item> GetItems()
 {
     return(HUtils.DeepCopyList(_items));
 }
Ejemplo n.º 7
0
        public override IPrototype Clone()
        {
            var deepCopyItemList = HUtils.DeepCopyList(_items);

            return(new Inventory(deepCopyItemList, deepCopyItemList.Capacity - deepCopyItemList.Count, _gold));
        }