载入中...
搜索中...
未找到
eve::dialogue::PaymentSpec结构体 参考

Canonical money/reputation cost attached to a dialogue choice or command. 更多...

#include <DialoguePayment.h>

Public 成员函数

bool empty () const noexcept
 Whether this specification contains no charge.
 
eve::Result< void > validate () const
 Validate that every present amount is a positive integer.
 
eve::Value toValue () const
 Project this payment into a deterministic canonical Value object.
 

静态 Public 成员函数

static eve::Result< PaymentSpec > fromValue (const eve::Value &value)
 Parse { "money": n, "reputation": n } from canonical Value.
 

Public 属性

std::optional< std::int64_t > money
 Optional money amount, in the configured money resource.
 
std::optional< std::int64_t > reputation
 Optional reputation amount, in the configured reputation resource.
 

详细描述

Canonical money/reputation cost attached to a dialogue choice or command.

Values are positive integral quantities. The specification is policy data, not a balance mirror: the actual values are read and changed only through the account adapters supplied to DialoguePaymentAdapter.

在文件 DialoguePayment.h 第 36 行定义.

成员函数说明

◆ empty()

bool eve::dialogue::PaymentSpec::empty ( ) const
inlinenoexcept

Whether this specification contains no charge.

在文件 DialoguePayment.h 第 43 行定义.

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

◆ fromValue()

eve::Result< PaymentSpec > eve::dialogue::PaymentSpec::fromValue ( const eve::Value &  value)
static

Parse { "money": n, "reputation": n } from canonical Value.

在文件 DialoguePayment.cpp 第 89 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Value::find(), eve::InvalidArgument, key, member, money, reputation, eve::Result< T >::success() , 以及 value.

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

◆ toValue()

eve::Value eve::dialogue::PaymentSpec::toValue ( ) const

Project this payment into a deterministic canonical Value object.

在文件 DialoguePayment.cpp 第 114 行定义.

引用了 money, object , 以及 reputation.

◆ validate()

eve::Result< void > eve::dialogue::PaymentSpec::validate ( ) const

Validate that every present amount is a positive integer.

在文件 DialoguePayment.cpp 第 79 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, money, reputation , 以及 eve::Result< T >::success().

类成员变量说明

◆ money

std::optional<std::int64_t> eve::dialogue::PaymentSpec::money

Optional money amount, in the configured money resource.

在文件 DialoguePayment.h 第 38 行定义.

被这些函数引用 fromValue(), toValue() , 以及 validate().

◆ reputation

std::optional<std::int64_t> eve::dialogue::PaymentSpec::reputation

Optional reputation amount, in the configured reputation resource.

在文件 DialoguePayment.h 第 40 行定义.

被这些函数引用 fromValue(), toValue() , 以及 validate().


该结构体的文档由以下文件生成: