GGUI::TemplateEntity class

TemplateEntity: a placeholder for "the entity this instance is drawn for".

A template is a widget function run once and drawn for many entities (UIContext::BuildTemplate). Its bindings go through a TemplateEntity and are evaluated per entity.

void Nameplate(UI& ui, TemplateEntity e)
{
    const GGExpr health = GGExpr::Field(HealthField) / GGExpr::Field(MaxHealthField);
    ui.Progress({ .Class = "health" }, e.Bind(health));
}

Public static variables

static BindTarget Target constexpr
Sentinel target carried by per-entity bindings.

Public functions

auto Bind(const GGExpr& expression) const -> GGBinding
expression, read for each entity the template is drawn for.