QtCraft API C++ classes QML types Handbook

QcMobBrain::Context Struct

struct QcMobBrain::Context

What one tick of all creatures shares, with the path rules of the creature at hand. More...

Public Variables

QList<QcMobManager::BlockAction> *blockActions
QList<QcMobManager::CreatureHit> *creatureHits
double dt
bool griefing
QList<QcMobManager::PlayerHit> *hits
QList<QcProjectileManager::Launch> *launches
std::span<const QcCreature> mobs
const QList<QcMobManager::PlayerView> *players
QcPathRules rules
quint64 tick
QcServerWorld &world
double worldTime

Detailed Description

Member Variable Documentation

QList<QcMobManager::BlockAction> *Context::blockActions

Blocks taken and put down in this tick (a shadewalker, decision E-460): QcMobManager:: takeBlockActions hands them to the server, which changes the blocks after the tick.

QList<QcMobManager::CreatureHit> *Context::creatureHits

Blows at other creatures this tick (a golem's, decision E-471; a pet's for its owner, decision E-480): QcMobManager::takeCreatureHits hands them to the server, which deals them after the tick.

double Context::dt

The tick's length in seconds.

bool Context::griefing

Game rule mobGriefing: without it no creature takes or places blocks.

QList<QcMobManager::PlayerHit> *Context::hits

Blows at players this tick.

QList<QcProjectileManager::Launch> *Context::launches

Shots of this tick (an archer's arrow, decision E-425): QcMobManager::takeLaunches hands them to the server, which adds them as projectiles in the phase of the creatures.

std::span<const QcCreature> Context::mobs

Every creature.

const QList<QcMobManager::PlayerView> *Context::players

The players.

QcPathRules Context::rules

The path rules of the creature at hand.

quint64 Context::tick

Ticks since the start: creatures look for players in turns, staggered by their ids.

QcServerWorld &Context::world

The world.

double Context::worldTime

The world time.