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); }
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); }
/// <summary> /// Returns HashCode of the range. /// </summary> public override int GetHashCode() { return(HUtils.GetHashCode(min, max)); }
public virtual IPrototype Clone() { return(new Item(name, iconName, Amount, HUtils.DeepCopyList(_components))); }
/// <summary> /// /// </summary> public override int GetHashCode() { return(HUtils.GetHashCode(x, y)); }
//------------------------------------------------------------------------------------------------------------------------ // GetItems() //------------------------------------------------------------------------------------------------------------------------ //returns a deepcopied list with all current items in the shop. public List <Item> GetItems() { return(HUtils.DeepCopyList(_items)); }
public override IPrototype Clone() { var deepCopyItemList = HUtils.DeepCopyList(_items); return(new Inventory(deepCopyItemList, deepCopyItemList.Capacity - deepCopyItemList.Count, _gold)); }