Item.opBinaryRight

Gets a pointer to the enchantment. This method can be used to check if the item has an enchantment and its level.

  1. void opBinaryRight(Enchantment ench)
  2. Enchantment* opBinaryRight(sul.enchantments.Enchantment ench)
    class Item
    @safe
    opBinaryRight
    (
    string op : "in"
    )
    (
    inout sul.enchantments.Enchantment ench
    )
  3. void opBinaryRight(sul.enchantments.Enchantment ench)

Examples

auto e = Enchantments.protection in item;
if(!e || e.level != 5) {
   item.enchant(Enchantment.protection, 5);
}
assert(Enchantments.protection in item);

Meta