Slot

Container for an item stack that has always a value. If the slot is not empty, an Item instance and the count can be stored.

Conventionally an empty slot is always constructed using Slot(null)

Constructors

this
this(Item item)

Creates a slot with an item and its highest value as count.

this
this(Item item, ubyte count)

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.

Members

Functions

fill
void fill()

Fills the slot setting the count as the max stacking value of the item.

opEquals
bool opEquals(Slot slot)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Item item)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(item_t item)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

empty
bool empty [@property getter]

Checks whether or not the slot is empty. A slot is considered empty when its count is equal to 0 or when its item is null.

full
bool full [@property getter]

Checks whether or not the slot is full. The slot is considered full when its count is equals or higher than the item's max stackable size.

item
Item item [@property getter]

Gets the slot's item.

Variables

count
ubyte count;
Undocumented in source.

Meta