QtCraft API C++ classes QML types Handbook

QcBlockEntities::Machine Struct

struct QcBlockEntities::Machine

The state of a machine block (a furnace): its slots, fuel, work and experience. More...

Public Functions

bool isCold() const
bool isIdle() const

Public Variables

double burnRemaining
double burnSeconds
double experience
QString name
QcBlockPos pos
double progress
QcItemId progressItem
std::array<QcItemStack, slotCount> stacks

Static Public Members

const int fuelSlot
const int inputSlot
const double maxExperience
const int outputSlot
const int slotCount

Detailed Description

Member Function Documentation

bool Machine::isCold() const

Returns whether nothing is in it and nothing burning or in progress: nothing to simulate (gathered experience waits without a step).

bool Machine::isIdle() const

Returns whether it is cold, without gathered experience and without a name: the same as a new one (removed, not saved).

Member Variable Documentation

QString Machine::name

The custom name of the item it was placed from (decision E-873); empty for none.

QcBlockPos Machine::pos

The position of the block.

std::array<QcItemStack, slotCount> Machine::stacks

The item stacks in its slots, indexed by inputSlot, fuelSlot and outputSlot.