载入中...
搜索中...
未找到
eve::dialogue::ConversationDocument类 参考

Mutable, UI-neutral conversation document for custom editor composition. 更多...

#include <ConversationAuthoring.h>

Public 成员函数

 ConversationDocument (std::string id={})
 Create an empty document with one end node.
 
 ConversationDocument (eve::dnut::SequenceAsset asset)
 Create an editable copy of a runtime asset.
 
const eve::dnut::SequenceAsset & asset () const
 Return the editable runtime asset.
 
const std::string & getId () const
 Return the stable conversation identifier.
 
bool setId (const std::string &id)
 Rename the document identifier.
 
int getVersion () const
 Return the asset schema version.
 
bool setVersion (int version)
 Set the asset schema version to a positive value.
 
const std::string & getEntry () const
 Return the entry node identifier.
 
bool setEntry (const std::string &nodeId)
 Set the entry node identifier.
 
int getParameterCount () const
 Return the number of declared parameters.
 
std::string getParameter (int index) const
 Return a declared parameter by insertion order.
 
bool addParameter (const std::string &name)
 Add a unique parameter.
 
bool removeParameter (const std::string &name)
 Remove a parameter.
 
int getNodeCount () const
 Return the number of graph nodes.
 
std::string getNodeId (int index) const
 Return a stable node identifier by insertion order.
 
bool hasNode (const std::string &nodeId) const
 Test whether a node exists.
 
bool addNode (const std::string &nodeId, const std::string &kind)
 Add a node of kind line, branch, choice, call, command, wait, or end.
 
bool removeNode (const std::string &nodeId)
 Remove a node and references to it.
 
bool renameNode (const std::string &oldId, const std::string &newId)
 Rename a node and rewrite graph references.
 
std::string getNodeKind (const std::string &nodeId) const
 Return a node kind name.
 
bool setNodeKind (const std::string &nodeId, const std::string &kind)
 Change a node kind while preserving compatible fields.
 
int getFieldCount (const std::string &nodeId) const
 Return the reflected inspector field count for a node kind.
 
std::string getFieldName (const std::string &nodeId, int index) const
 Return a reflected field key.
 
std::string getFieldKind (const std::string &nodeId, int index) const
 Return a field UI hint such as string, multiline, expression, asset, or json.
 
std::string getField (const std::string &nodeId, const std::string &field) const
 Return a scalar field value by key.
 
bool setField (const std::string &nodeId, const std::string &field, const std::string &value)
 Set a scalar field value by key.
 
int getRouteCount (const std::string &nodeId) const
 Return the number of outgoing conditional or choice routes.
 
std::string getRouteLabel (const std::string &nodeId, int index) const
 Return a route label or expression.
 
std::string getRouteTarget (const std::string &nodeId, int index) const
 Return a route destination.
 
bool addRoute (const std::string &nodeId, const std::string &label, const std::string &target)
 Append an outgoing route.
 
bool setRoute (const std::string &nodeId, int index, const std::string &label, const std::string &target)
 Replace an outgoing route.
 
bool removeRoute (const std::string &nodeId, int index)
 Remove an outgoing route.
 
bool validate ()
 Validate the graph and refresh structured diagnostics.
 
int getDiagnosticCount () const
 Return the current diagnostic count.
 
std::string getDiagnosticSeverity (int index) const
 Return error or warning.
 
std::string getDiagnosticPath (int index) const
 Return a diagnostic source path.
 
int getDiagnosticLine (int index) const
 Return a diagnostic line, or zero for graph diagnostics.
 
std::string getDiagnosticMessage (int index) const
 Return a diagnostic message.
 

详细描述

Mutable, UI-neutral conversation document for custom editor composition.

在文件 ConversationAuthoring.h 第 13 行定义.

构造及析构函数说明

◆ ConversationDocument() [1/2]

eve::dialogue::ConversationDocument::ConversationDocument ( std::string  id = {})
explicit

Create an empty document with one end node.

在文件 ConversationAuthoring.cpp 第 54 行定义.

引用了 end, eve::dnut::SequenceAsset::entry, eve::dnut::SequenceNode::id, eve::dnut::SequenceAsset::id , 以及 eve::dnut::SequenceAsset::nodes.

◆ ConversationDocument() [2/2]

eve::dialogue::ConversationDocument::ConversationDocument ( eve::dnut::SequenceAsset  asset)
explicit

Create an editable copy of a runtime asset.

在文件 ConversationAuthoring.cpp 第 63 行定义.

成员函数说明

◆ addNode()

bool eve::dialogue::ConversationDocument::addNode ( const std::string &  nodeId,
const std::string &  kind 
)

Add a node of kind line, branch, choice, call, command, wait, or end.

在文件 ConversationAuthoring.cpp 第 134 行定义.

引用了 eve::dnut::SequenceNode::id, kind, node, nodeId , 以及 eve::dnut::SequenceAsset::nodes.

◆ addParameter()

bool eve::dialogue::ConversationDocument::addParameter ( const std::string &  name)

Add a unique parameter.

在文件 ConversationAuthoring.cpp 第 108 行定义.

引用了 name , 以及 eve::dnut::SequenceAsset::parameters.

◆ addRoute()

bool eve::dialogue::ConversationDocument::addRoute ( const std::string &  nodeId,
const std::string &  label,
const std::string &  target 
)

Append an outgoing route.

在文件 ConversationAuthoring.cpp 第 270 行定义.

引用了 label, eve::dnut::SequenceRoute::label, node, nodeId, target , 以及 eve::dnut::SequenceRoute::target.

◆ asset()

const eve::dnut::SequenceAsset & eve::dialogue::ConversationDocument::asset ( ) const
inline

Return the editable runtime asset.

在文件 ConversationAuthoring.h 第 21 行定义.

被这些函数引用 eve::dialogue::DialogueFlow::applyDocumentChecked().

◆ getDiagnosticCount()

int eve::dialogue::ConversationDocument::getDiagnosticCount ( ) const

Return the current diagnostic count.

在文件 ConversationAuthoring.cpp 第 306 行定义.

被这些函数引用 getDiagnosticSeverity().

◆ getDiagnosticLine()

int eve::dialogue::ConversationDocument::getDiagnosticLine ( int  index) const

Return a diagnostic line, or zero for graph diagnostics.

在文件 ConversationAuthoring.cpp 第 320 行定义.

引用了 index.

◆ getDiagnosticMessage()

std::string eve::dialogue::ConversationDocument::getDiagnosticMessage ( int  index) const

Return a diagnostic message.

在文件 ConversationAuthoring.cpp 第 324 行定义.

引用了 index.

◆ getDiagnosticPath()

std::string eve::dialogue::ConversationDocument::getDiagnosticPath ( int  index) const

Return a diagnostic source path.

在文件 ConversationAuthoring.cpp 第 315 行定义.

引用了 index.

◆ getDiagnosticSeverity()

std::string eve::dialogue::ConversationDocument::getDiagnosticSeverity ( int  index) const

Return error or warning.

在文件 ConversationAuthoring.cpp 第 308 行定义.

引用了 eve::dialogue::ConversationDiagnostic::Error, getDiagnosticCount() , 以及 index.

◆ getEntry()

const std::string & eve::dialogue::ConversationDocument::getEntry ( ) const
inline

Return the entry node identifier.

在文件 ConversationAuthoring.h 第 31 行定义.

◆ getField()

std::string eve::dialogue::ConversationDocument::getField ( const std::string &  nodeId,
const std::string &  field 
) const

Return a scalar field value by key.

在文件 ConversationAuthoring.cpp 第 207 行定义.

引用了 eve::Value::find(), key, node, nodeId, eve::Value::toJson() , 以及 value.

◆ getFieldCount()

int eve::dialogue::ConversationDocument::getFieldCount ( const std::string &  nodeId) const

Return the reflected inspector field count for a node kind.

在文件 ConversationAuthoring.cpp 第 188 行定义.

引用了 node , 以及 nodeId.

◆ getFieldKind()

std::string eve::dialogue::ConversationDocument::getFieldKind ( const std::string &  nodeId,
int  index 
) const

Return a field UI hint such as string, multiline, expression, asset, or json.

在文件 ConversationAuthoring.cpp 第 200 行定义.

引用了 fields, index, node, nodeId , 以及 second.

◆ getFieldName()

std::string eve::dialogue::ConversationDocument::getFieldName ( const std::string &  nodeId,
int  index 
) const

Return a reflected field key.

在文件 ConversationAuthoring.cpp 第 193 行定义.

引用了 fields, first, index, node , 以及 nodeId.

◆ getId()

const std::string & eve::dialogue::ConversationDocument::getId ( ) const
inline

Return the stable conversation identifier.

在文件 ConversationAuthoring.h 第 23 行定义.

◆ getNodeCount()

int eve::dialogue::ConversationDocument::getNodeCount ( ) const

Return the number of graph nodes.

在文件 ConversationAuthoring.cpp 第 126 行定义.

引用了 eve::dnut::SequenceAsset::nodes.

被这些函数引用 getNodeId().

◆ getNodeId()

std::string eve::dialogue::ConversationDocument::getNodeId ( int  index) const

Return a stable node identifier by insertion order.

在文件 ConversationAuthoring.cpp 第 128 行定义.

引用了 getNodeCount(), index , 以及 eve::dnut::SequenceAsset::nodes.

◆ getNodeKind()

std::string eve::dialogue::ConversationDocument::getNodeKind ( const std::string &  nodeId) const

Return a node kind name.

在文件 ConversationAuthoring.cpp 第 174 行定义.

引用了 node , 以及 nodeId.

◆ getParameter()

std::string eve::dialogue::ConversationDocument::getParameter ( int  index) const

Return a declared parameter by insertion order.

在文件 ConversationAuthoring.cpp 第 103 行定义.

引用了 getParameterCount(), index, name , 以及 eve::dnut::SequenceAsset::parameters.

◆ getParameterCount()

int eve::dialogue::ConversationDocument::getParameterCount ( ) const

Return the number of declared parameters.

在文件 ConversationAuthoring.cpp 第 101 行定义.

引用了 eve::dnut::SequenceAsset::parameters.

被这些函数引用 getParameter().

◆ getRouteCount()

int eve::dialogue::ConversationDocument::getRouteCount ( const std::string &  nodeId) const

Return the number of outgoing conditional or choice routes.

在文件 ConversationAuthoring.cpp 第 251 行定义.

引用了 node , 以及 nodeId.

◆ getRouteLabel()

std::string eve::dialogue::ConversationDocument::getRouteLabel ( const std::string &  nodeId,
int  index 
) const

Return a route label or expression.

在文件 ConversationAuthoring.cpp 第 256 行定义.

引用了 index, label, node , 以及 nodeId.

◆ getRouteTarget()

std::string eve::dialogue::ConversationDocument::getRouteTarget ( const std::string &  nodeId,
int  index 
) const

Return a route destination.

在文件 ConversationAuthoring.cpp 第 263 行定义.

引用了 index, node, nodeId , 以及 target.

◆ getVersion()

int eve::dialogue::ConversationDocument::getVersion ( ) const
inline

Return the asset schema version.

在文件 ConversationAuthoring.h 第 27 行定义.

◆ hasNode()

bool eve::dialogue::ConversationDocument::hasNode ( const std::string &  nodeId) const

Test whether a node exists.

在文件 ConversationAuthoring.cpp 第 132 行定义.

引用了 nodeId.

◆ removeNode()

bool eve::dialogue::ConversationDocument::removeNode ( const std::string &  nodeId)

◆ removeParameter()

bool eve::dialogue::ConversationDocument::removeParameter ( const std::string &  name)

Remove a parameter.

在文件 ConversationAuthoring.cpp 第 118 行定义.

引用了 found , 以及 eve::dnut::SequenceAsset::parameters.

◆ removeRoute()

bool eve::dialogue::ConversationDocument::removeRoute ( const std::string &  nodeId,
int  index 
)

Remove an outgoing route.

在文件 ConversationAuthoring.cpp 第 292 行定义.

引用了 index, node , 以及 nodeId.

◆ renameNode()

bool eve::dialogue::ConversationDocument::renameNode ( const std::string &  oldId,
const std::string &  newId 
)

Rename a node and rewrite graph references.

在文件 ConversationAuthoring.cpp 第 163 行定义.

引用了 eve::dnut::SequenceAsset::id , 以及 eve::dialogue::renameConversationNode().

◆ setEntry()

bool eve::dialogue::ConversationDocument::setEntry ( const std::string &  nodeId)

Set the entry node identifier.

在文件 ConversationAuthoring.cpp 第 94 行定义.

引用了 eve::dnut::SequenceAsset::entry , 以及 nodeId.

◆ setField()

bool eve::dialogue::ConversationDocument::setField ( const std::string &  nodeId,
const std::string &  field,
const std::string &  value 
)

Set a scalar field value by key.

在文件 ConversationAuthoring.cpp 第 221 行定义.

引用了 eve::Value::fromJson(), eve::Value::isObject(), kind, name, node, nodeId, eve::Value::string() , 以及 value.

◆ setId()

bool eve::dialogue::ConversationDocument::setId ( const std::string &  id)

Rename the document identifier.

在文件 ConversationAuthoring.cpp 第 80 行定义.

引用了 id , 以及 eve::dnut::SequenceAsset::id.

◆ setNodeKind()

bool eve::dialogue::ConversationDocument::setNodeKind ( const std::string &  nodeId,
const std::string &  kind 
)

Change a node kind while preserving compatible fields.

在文件 ConversationAuthoring.cpp 第 179 行定义.

引用了 kind, node , 以及 nodeId.

◆ setRoute()

bool eve::dialogue::ConversationDocument::setRoute ( const std::string &  nodeId,
int  index,
const std::string &  label,
const std::string &  target 
)

Replace an outgoing route.

在文件 ConversationAuthoring.cpp 第 282 行定义.

引用了 index, label, node, nodeId , 以及 target.

◆ setVersion()

bool eve::dialogue::ConversationDocument::setVersion ( int  version)

Set the asset schema version to a positive value.

在文件 ConversationAuthoring.cpp 第 87 行定义.

引用了 eve::dnut::SequenceAsset::version.

◆ validate()

bool eve::dialogue::ConversationDocument::validate ( )

Validate the graph and refresh structured diagnostics.

在文件 ConversationAuthoring.cpp 第 299 行定义.

引用了 eve::dnut::SequenceAsset::id, eve::dialogue::lintConversations(), ok , 以及 valid.


该类的文档由以下文件生成: