QtCraft API C++ classes QML types Handbook

QcClientMaps Class

The maps the server sent (decision E-802), part of the world mirror: per map id its picture (QcMapData), the markers of its last update and a revision that grows with every update, so a drawn image of the map can tell it is out of date. More...

Header: #include <clientcore/maps/QcClientMaps.h>

Public Types

struct Map

Public Functions

void apply(const QcMsg::MapUpdate &update)
qsizetype count() const
const QcClientMaps::Map *find(quint32 id) const

Static Public Members

const int maxMaps

Detailed Description

The server sends a map only to players holding it; the client keeps at most maxMaps of them and forgets the one updated longest ago.

Member Function Documentation

void QcClientMaps::apply(const QcMsg::MapUpdate &update)

Applies update: the first one of an id, or one with another scale or centre, starts a blank map; the pixels of its area are written, the markers replaced. An update whose scale or centre is out of range is ignored; pixels that do not fit the area are left out (logged).

qsizetype QcClientMaps::count() const

Returns the number of maps the client holds.

const QcClientMaps::Map *QcClientMaps::find(quint32 id) const

Returns the map id, or null while the client has none.

Member Variable Documentation

const int QcClientMaps::maxMaps

Most maps the client keeps.