QtCraft API C++ classes QML types Handbook

QcBoat Struct

A boat (decision E-920): floats on water, falls without it and moves by the shared boat physics (QcBoatState). More...

Header: #include <server/entities/QcBoat.h>
Inherits: QcEntity

Public Types

struct Rest

Public Functions

void setState(const QcBoatState &state)
QcBoatState state() const

Public Variables

quint32 driver
QcVec3 driverSeat
QString item
quint32 passenger
QcVec3 passengerSeat
std::optional<QcBoat::Rest> rest
bool rowing
float spin

Static Public Members

const QcEntityKind entityKind

Detailed Description

It carries one player, the driver, and one creature in its front seat. motion and yaw are its own, spin how fast it turns (degrees per tick).

Member Function Documentation

void QcBoat::setState(const QcBoatState &state)

Takes motion, yaw and spin from state after a step of the shared physics.

See also state().

QcBoatState QcBoat::state() const

Returns the state the shared physics steps.

See also setState().

Member Variable Documentation

const QcEntityKind QcBoat::entityKind

The kind of every entity of this type (QcEntity::as).

QString QcBoat::item

The item it drops when broken (the one that placed it); its boatBlock says what it is built of.

std::optional<QcBoat::Rest> QcBoat::rest

Where it rests now; std::nullopt while it moves or may move.

bool QcBoat::rowing

The driver's latest input paddled or turned (QcMsg::Rowing; not saved): its paddles row.

float QcBoat::spin

How fast it turns, degrees per tick.