Item.consumeable

Indicates whether or not an item can be eaten/drunk. If true, Item::onConsumed(Human consumer) will be called when this item is eaten/drunk.

class Item
pure nothrow @property @safe @nogc
bool
consumeable
()

Examples

if(item.consumeable) {
   Item residue;
   if((residue = item.onConsumed(player)) !is null) {
      player.held = residue;
   }
}

Meta