EntitySplit.h header
#include <ew/app/EntitySplit.h>
Namespace ew::app
Functions
std::unique_ptr< ew::core::undo::Command > ew::app::entity::buildSplitEntityCommand(ew::core::project::Project &project, ew::core::foundation::ContentId sourceId, ew::core::foundation::ContentId newId, const QString &newName, const std::vector< QString > &fieldKeysToCopy, bool copyLifespan)
Builds an undoable command that splits a new entity off sourceId within project: it creates a fresh entity with identity newId and display name newName in the source's category, copying the field values named in fieldKeysToCopy (those the source actually has) and, when copyLifespan is set, the source's birth/death instants. The source entity is left untouched – a split duplicates the shared parts into a second entity so the writer can then divide the references and prose between the two by hand (which reference belongs to which is a judgement the tool cannot make). Applying adds the new entity; undo removes it.
The new entity inherits the source's audience visibility and AI-exclusion flag, because the copied field values carry whatever secret the source held: a split of a GM-only entity must not put its secrets in front of the players, and a split of an AI-excluded one must not start sending that content to the configured provider. Widening either afterwards is the writer's call. Aliases, gallery, tags and state-over-time are NOT copied – those identify the source rather than describing the shared content.
Returns null when the split is not well-formed: sourceId does not identify an entity in project, newId is null or already in use, or newName is blank.