DialogueCommand.h header

#include <ew/core/branching/DialogueCommand.h>

Namespace ew::core::branching

DialogueCommand struct

struct ew::core::branching::DialogueCommand

One command a line's production sequence may use – Camera, Audio, Animation – as the project declares it.

A project declares its own vocabulary rather than inheriting a fixed one. What a sequence can say is a property of the runtime the script is being written for: a Unity title using the Dialogue System, an in-house engine and a radio drama have three different command sets and no list shipped here would be right for any of them. Declaring the set is also what makes a typo catchable – Camara(Closeup) is indistinguishable from a command the engine has until something says which commands exist.

A project with no declared commands does not validate sequences at all, so an author can write direction before anybody has settled the vocabulary; the validator says the vocabulary is empty rather than calling every command unknown.

Members

QString ew::core::branching::DialogueCommand::name

The command's name as it is written in a sequence, e.g. Camera.

Compared case-insensitively when a directive is validated, because a vocabulary that rejected camera for Camera would be catching a difference nobody means.

QString ew::core::branching::DialogueCommand::description

What the command does, in the author's own words – shown where they pick it.

A vocabulary of bare names is a vocabulary only its author can use; the writer attaching direction to a line is often not the programmer who declared the command.

std::vector<QString> ew::core::branching::DialogueCommand::parameters

The parameters it takes, named and in order.

Names rather than types: they are what the author is shown while filling the command in, and a type system here would be a second one to keep in step with the engine's. The count is what the validator checks.

bool ew::core::branching::DialogueCommand::variadic = false

Whether the command accepts further arguments beyond parameters.

For the genuinely variable-length command – a list of clips, a set of flags. Without it a vocabulary would have to choose between rejecting real direction and checking nothing, and the first thing an author would do is stop declaring the command at all.

bool operator==(const DialogueCommand &, const DialogueCommand &)=default

Commands compare equal when every field matches.

Functions

bool ew::core::branching::sameDialogueCommand(const QString &declared, const QString &written)

Whether declared and written name the same command.

The one place that decides it, so the validator, the editor's picker and the exporter cannot disagree about whether camera is Camera – the same rule, and the same reason, as ew::core::content::normalizedTag.