CategoryMembership.h header
#include <ew/app/CategoryMembership.h>
Namespace ew::app
Functions
std::vector< const ew::core::entity::Entity * > ew::app::entity::entitiesInCategory(const ew::core::project::Project &project, ew::core::foundation::CategoryId categoryId)
Every entity in project that carries categoryId, in project order.
bool ew::app::entity::isInCategory(const ew::core::project::Project &project, const ew::core::entity::Entity &entity, ew::core::foundation::CategoryId categoryId)
Whether entity carries the category categoryId – as its primary, as one of its additional memberships, or by sitting beneath it.
The one answer to "is this an Item". Before composable typing every caller could ask entity.categoryId() == id and be right; now that is a question about PLACEMENT, and asking it where the question was really about membership is exactly how a sword that is an Item as its second membership escapes every rule, sheet and filter written for Items. One predicate, so the answer cannot differ between the validator that reports and the view that lists.
std::vector< QString > ew::app::entity::membershipNames(const ew::core::project::Project &project, const ew::core::entity::Entity &entity)
The names of entity's memberships, primary first, for a label a reader can act on.
Empty for an uncategorized entity, and one name for almost every entity there has ever been – which is why a caller should show the list only when it has more than one, rather than turning every character in the project into "Character".