Slot.this

Creates a slot giving an item and a count in range 0..255 (unsigned byte). Setting an higher value it's impossible due to protocol's limitations.

  1. this(Item item)
  2. this(Item item, ubyte count)
    struct Slot
    @safe @nogc
    this
    (,
    ubyte count
    )

Examples

assert(Slot(new Items.DiamondSword(), 22).count == 22);
assert(Slot(new Items.Snowball(), 2).count == 2);
assert(Slot(null, 100).count == 0);

Meta