StatBlockTemplate.h header

#include <ew/app/StatBlockTemplate.h>

Namespace ew::app

StatBlockTemplate struct

struct ew::app::StatBlockTemplate

A starter stat-block layout for one game system (DESIGN 4.17): the ordered set of labelled statistics and named action slots a fresh creature/NPC block for that system usually carries, so authoring a block for D&D 5e or Pathfinder 2e starts from the right fields rather than a blank slate. Templates are read-only reference data with blank values – the writer fills them in; a project stores only the resulting ew::core::StatBlock, never a reference to the template.

Members

QString ew::app::StatBlockTemplate::id

The stable id of the template (kebab-case, e.g. "dnd5e"); used for lookup and persistence of a UI choice.

QString ew::app::StatBlockTemplate::system

The system label written onto a block created from this template (e.g. "D&D 5e"). Empty for the system-neutral template.

QString ew::app::StatBlockTemplate::description

A one-line description of the template.

std::vector<ew::core::StatEntry> ew::app::StatBlockTemplate::stats

The starter statistics, in display order, with empty values for the author to fill.

std::vector<ew::core::StatBlockAction> ew::app::StatBlockTemplate::actions

The starter action / attack / trait slots, in display order, with empty text for the author to fill.

Functions

void ew::app::applyStatBlockTemplate(ew::core::StatBlock &block, const StatBlockTemplate &statBlockTemplate)

Populates block from statBlockTemplate: sets its system label and replaces its statistics and actions with the template's starter set. The block's title and notes are left unchanged. Used to seed a newly created block; callers route the resulting state through a command for undo.

std::vector< StatBlockTemplate > ew::app::builtInStatBlockTemplates()

The catalogue of built-in stat-block templates: D&D 5e, Pathfinder 2e, and a system-neutral "Custom" skeleton. Returned in a stable order for display.

const StatBlockTemplate * ew::app::findStatBlockTemplate(const QString &id)

The built-in template with id, or null if none matches. The pointer is into a static catalogue and remains valid for the lifetime of the program.