载入中...
搜索中...
未找到

The canonical owning dynamic value used by data-facing protocols. 更多...

#include <Value.h>

Public 类型

enum class  Type : std::uint8_t {
  Null = 0 , Bool , Int64 , Double ,
  String , Array , Object , Integer = Int64 ,
  Number = Double , Int = Int64 , Float = Double
}
 Runtime kind of the owned value. 更多...
 
using Array = std::vector< Value >
 
using Object = std::map< std::string, Value >
 
using Storage = std::variant< std::monostate, bool, std::int64_t, double, std::string, Array, Object >
 
using Kind = Type
 Compatibility spelling for code that used StateValue::Kind.
 

Public 成员函数

 Value () noexcept
 Construct a null value.
 
 Value (std::nullptr_t)
 Construct a null value from nullptr.
 
 Value (bool value)
 Construct a boolean value.
 
 Value (std::int64_t value)
 Construct an Int64 value without narrowing.
 
 Value (int value)
 Construct an integer value using the canonical Int64 type.
 
 Value (double value)
 Construct a Double value; non-finite values serialize as errors.
 
 Value (float value)
 Construct a Double value from a float.
 
 Value (const char *value)
 Construct a string value, copying the supplied text.
 
 Value (std::string value)
 Construct a string value by taking the supplied text.
 
 Value (Array value)
 Construct an array value by taking its elements.
 
 Value (Object value)
 Construct an object value by taking its members.
 
 ~Value () noexcept
 Destroy the recursively owned payload.
 
 Value (const Value &other)
 Copy the recursively owned payload.
 
 Value (Value &&other) noexcept
 Move the owned payload without copying.
 
Value & operator= (const Value &other)
 Replace this payload with a recursive copy.
 
Value & operator= (Value &&other) noexcept
 Replace this payload by moving ownership.
 
Type type () const noexcept
 Return the active value kind.
 
Type kind () const noexcept
 Compatibility spelling for the former dialogue data tree.
 
bool isNull () const noexcept
 Return true when this value is null.
 
bool isBool () const noexcept
 Return true when this value is a boolean.
 
bool isInt64 () const noexcept
 Return true when this value is an Int64.
 
bool isDouble () const noexcept
 Return true when this value is a Double.
 
bool isString () const noexcept
 Return true when this value is a string.
 
bool isArray () const noexcept
 Return true when this value is an array.
 
bool isObject () const noexcept
 Return true when this value is an object.
 
std::int64_t asInt () const
 Return the Int64 payload; the caller must have checked the kind.
 
double asDouble () const
 Return the Double payload; the caller must have checked the kind.
 
bool asBool () const
 Return the boolean payload; the caller must have checked the kind.
 
const std::string & asString () const
 Return the string payload; the caller must have checked the kind.
 
void pushBack (Value value)
 Append an element to an array value.
 
std::size_t arraySize () const
 Return the number of array elements.
 
Value & at (std::size_t index)
 Return a bounds-checked array element.
 
const Value & at (std::size_t index) const
 Return a bounds-checked immutable array element.
 
void set (const std::string &key, Value value)
 Insert or replace an object member.
 
Value * find (const std::string &key) noexcept
 Return an object member, or nullptr when absent.
 
const Value * find (const std::string &key) const noexcept
 Return an immutable object member, or nullptr when absent.
 
std::vector< std::string > keys () const
 Return object member names in deterministic order.
 
bool isNumeric () const noexcept
 Return whether this value is an integer or finite number.
 
std::string typeName () const
 Return the compatibility type name used by dialogue scripts.
 
std::string toString () const
 Render a scalar using the former dialogue formatting rules.
 
const Storage & storage () const noexcept
 Return the immutable variant storage for visitors.
 
Storage & storage () noexcept
 Return mutable variant storage for owning edits.
 
template<class T >
const T * getIf () const noexcept
 Return a typed pointer, or nullptr when the kind differs.
 
template<class T >
T * getIf () noexcept
 Return a mutable typed pointer, or nullptr when the kind differs.
 
Result< std::string > toJson () const
 Serialize this value as deterministic compact JSON.
 
bool operator== (const Value &) const
 Compare two values recursively, including their numeric kinds.
 

静态 Public 成员函数

static Value null ()
 Compatibility factory for a null value.
 
static Value integer (std::int64_t value)
 Compatibility factory for an Int64 value.
 
static Value number (double value)
 Compatibility factory for a Double value.
 
static Value boolean (bool value)
 Compatibility factory for a boolean value.
 
static Value string (std::string value)
 Compatibility factory for a string value.
 
static Value array (Array value)
 Compatibility factory for an array value.
 
static Value object (Object value)
 Compatibility factory for an object value.
 
static Value array (std::initializer_list< Value > values)
 Copy elements into an owning array without a caller-side vector temporary.
 
static Value object (std::initializer_list< Object::value_type > members)
 Copy members into an owning object with lexicographically ordered keys.
 
static Result< Value > fromJson (std::string_view json)
 Parse one strict JSON value into an owning Value.
 

详细描述

The canonical owning dynamic value used by data-facing protocols.

A Value owns all recursively contained storage. Object members use std::map, so key traversal and compact JSON serialization are deterministic. Native pointers, ECS handles, renderer objects and other domain-specific values are intentionally not part of this protocol.

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

成员类型定义说明

◆ Array

using eve::Value::Array = std::vector<Value>

在文件 Value.h 第 33 行定义.

◆ Kind

Compatibility spelling for code that used StateValue::Kind.

在文件 Value.h 第 57 行定义.

◆ Object

using eve::Value::Object = std::map<std::string, Value>

在文件 Value.h 第 34 行定义.

◆ Storage

using eve::Value::Storage = std::variant<std::monostate, bool, std::int64_t, double, std::string, Array, Object>

在文件 Value.h 第 35 行定义.

成员枚举类型说明

◆ Type

enum class eve::Value::Type : std::uint8_t
strong

Runtime kind of the owned value.

枚举值
Null 
Bool 
Int64 
Double 
String 
Array 
Object 
Integer 

Compatibility spelling for Int64.

Number 

Compatibility spelling for Double.

Int 

Compatibility spelling used by the former dialogue value.

Float 

Compatibility spelling used by the former dialogue value.

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

构造及析构函数说明

◆ Value() [1/13]

eve::Value::Value ( )
defaultnoexcept

Construct a null value.

被这些函数引用 array(), array(), object() , 以及 object().

◆ Value() [2/13]

eve::Value::Value ( std::nullptr_t  )

Construct a null value from nullptr.

在文件 Value.cpp 第 111 行定义.

◆ Value() [3/13]

eve::Value::Value ( bool  value)

Construct a boolean value.

在文件 Value.cpp 第 112 行定义.

◆ Value() [4/13]

eve::Value::Value ( std::int64_t  value)

Construct an Int64 value without narrowing.

在文件 Value.cpp 第 113 行定义.

◆ Value() [5/13]

eve::Value::Value ( int  value)

Construct an integer value using the canonical Int64 type.

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

◆ Value() [6/13]

eve::Value::Value ( double  value)

Construct a Double value; non-finite values serialize as errors.

在文件 Value.cpp 第 115 行定义.

◆ Value() [7/13]

eve::Value::Value ( float  value)

Construct a Double value from a float.

在文件 Value.cpp 第 116 行定义.

◆ Value() [8/13]

eve::Value::Value ( const char *  value)

Construct a string value, copying the supplied text.

在文件 Value.cpp 第 117 行定义.

引用了 string.

◆ Value() [9/13]

eve::Value::Value ( std::string  value)

Construct a string value by taking the supplied text.

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

◆ Value() [10/13]

eve::Value::Value ( Array  value)

Construct an array value by taking its elements.

在文件 Value.cpp 第 119 行定义.

◆ Value() [11/13]

eve::Value::Value ( Object  value)

Construct an object value by taking its members.

在文件 Value.cpp 第 120 行定义.

◆ ~Value()

eve::Value::~Value ( )
defaultnoexcept

Destroy the recursively owned payload.

◆ Value() [12/13]

eve::Value::Value ( const Value &  other)
default

Copy the recursively owned payload.

◆ Value() [13/13]

eve::Value::Value ( Value &&  other)
defaultnoexcept

Move the owned payload without copying.

成员函数说明

◆ array() [1/2]

◆ array() [2/2]

Value eve::Value::array ( std::initializer_list< Value >  values)
static

Copy elements into an owning array without a caller-side vector temporary.

参数
valuesBorrowed elements, copied before return; no references are retained.
返回
Independent array value. @cost Linear in the number and recursively owned size of elements, once per construction. @thread No shared mutable state; inputs must remain stable during the call. @reentrancy Does not invoke callbacks.

在文件 Value.cpp 第 130 行定义.

引用了 Value() , 以及 values.

◆ arraySize()

◆ asBool()

bool eve::Value::asBool ( ) const

Return the boolean payload; the caller must have checked the kind.

在文件 Value.cpp 第 201 行定义.

引用了 EV_ASSERT , 以及 value.

被这些函数引用 eve::statepatch::StatePatchStateAdapter::hasTag(), eve::asset_procgen::EvpackInstanceSetLoader::load(), eve::dnut::SequenceRuntime::restoreState() , 以及 toString().

◆ asDouble()

double eve::Value::asDouble ( ) const

Return the Double payload; the caller must have checked the kind.

在文件 Value.cpp 第 195 行定义.

引用了 EV_ASSERT , 以及 value.

被这些函数引用 eve::action::ActionTimeline::fromValue(), eve::hexmap::hexTerrainBakeFromValue(), eve::asset_procgen::EvpackTerrainMaterialLoader::load(), eve::rpg::Tracker::restoreSnapshotJson() , 以及 toString().

◆ asInt()

◆ asString()

◆ at() [1/2]

◆ at() [2/2]

const Value & eve::Value::at ( std::size_t  index) const

Return a bounds-checked immutable array element.

在文件 Value.cpp 第 232 行定义.

引用了 array(), at(), EV_ASSERT , 以及 index.

◆ boolean()

static Value eve::Value::boolean ( bool  value)
inlinestatic

◆ find() [1/2]

const Value * eve::Value::find ( const std::string &  key) const
noexcept

Return an immutable object member, or nullptr when absent.

返回
Borrowed const pointer into this Value; nullptr when not an object or key is absent. @ownership Borrowed; this Value owns the returned member. @nullable Yes. @lifetime Valid until this Value is destroyed, moved, or structurally mutated. @thread Affine to this Value; no synchronization. @reentrancy Does not invoke callbacks.

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

引用了 key.

◆ find() [2/2]

Value * eve::Value::find ( const std::string &  key)
noexcept

Return an object member, or nullptr when absent.

返回
Borrowed mutable pointer into this Value; nullptr when not an object or key is absent. @ownership Borrowed; this Value owns the returned member. @nullable Yes. @lifetime Valid until this Value is destroyed, moved, or structurally mutated. @thread Affine to this Value; no synchronization. @reentrancy Does not invoke callbacks.

在文件 Value.cpp 第 244 行定义.

引用了 key.

被这些函数引用 eve::avatar::Appearance::apply(), eve::condition::authorityAllowScope(), eve::dialogue::decodeDialogueCommandRequest(), eve::dialogue::decodeSequencePayment(), eve::dialogue::decodeSequenceStateMutations(), eve::fluids::decodeVolumeFluid(), eve::fluids::decodeVolumeFluidEmission(), eve::physics::snapshot_detail::field(), eve::dialogue::PaymentSpec::fromValue(), eve::dialogue::ConversationDocument::getField(), eve::hexmap::hexTerrainBakeFromValue(), eve::dialogue::lintConversationWorkspace(), eve::map::member(), eve::scene::member(), eve::asset_import::gltf::member(), eve::schema::SchemaRegistry::migrate(), eve::physics::snapshot_detail::migratePlanarV2(), eve::rpg::RPGSaveSession::prepareRestoreSnapshotJson(), eve::inventory::InventorySaveSession::prepareRestoreSnapshotJson(), eve::physics::World3D::restore(), eve::procgen::ArtifactPublisher::restore(), eve::GameSaveSession::restoreJson(), eve::restoreScriptComponents(), eve::rpg::GameState::restoreSnapshotJson(), eve::rpg::Tracker::restoreSnapshotJson(), eve::dnut::SequenceRuntime::restoreState(), eve::dnut::SequenceRuntime::resumeStep(), eve::scriptComponentField(), eve::scriptComponentInstancesOf(), eve::dialogue::sequencePayloadString(), eve::dialogue::sequenceRoutePayloadString(), eve::dnut::SequenceRuntime::start(), eve::dnut::SequenceAsset::validate() , 以及 eve::dnut::StepKindRegistry::validate().

◆ fromJson()

Result< Value > eve::Value::fromJson ( std::string_view  json)
static

Parse one strict JSON value into an owning Value.

参数
jsonUTF-8 JSON text; duplicate object keys are rejected.
返回
The parsed value, or a ParseError diagnostic.
备注
JSON numbers without a fraction or exponent must fit Int64; fractional and exponent forms become finite Double values.

在文件 Value.cpp 第 177 行定义.

引用了 error, eve::Diagnostic::error(), eve::Result< T >::failure(), input, eve::json::Document::parse(), eve::ParseError, eve::json::Document::root() , 以及 eve::json::Document::valid().

被这些函数引用 eve::procgen::ModuleAssemblyPlan::applyConfigJson(), eve::editor::ActionTimelineTarget::applyDomainOperation(), eve::animation_editing::ControlRigDocument::applyDomainOperation(), eve::physics::Destruction::assetFromJson(), eve::rpg::RpgStorySession::begin(), eve::asset_import::bindUnityRenderers(), eve::rpg::RPGGameSaveParticipant::capture(), eve::rpg::Party::checkpointJson(), eve::weapon::compileSpellFragmentsJson(), eve::settlement::SettlementRuleSet::configureJson(), eve::asset::cookCanonicalImageRgba8(), eve::asset::cookCanonicalPcgGraph(), eve::asset::cookCanonicalVolumeTextureRgba8(), eve::asset::cookEvaToEvpack(), eve::rpg::ForgeBench::craftFromJson(), eve::dev::executePlayJson(), eve::editor::exposeActionTimelineScriptBindings(), eve::avatar::exposeAppearance(), eve::script::exposeResultBindings(), eve::daynight::exposeSkyScriptBindings(), eve::graphics::WaterStyleConfig::fromJson(), eve::physics::ClothModel::fromJson(), eve::stylize::AttackVfxSkin::fromJson(), eve::stylize::AttackVfxRecipe::fromJson(), eve::stylize::MeshVfxAsset::fromJson(), eve::editor::ActionTimelineWidget::inspectSelection(), eve::dev::liveGameWorldSnapshot(), eve::editor::ActionPreviewProfileStore::load(), eve::rts::RTSContentLoader::load(), eve::dev::loadActionGuideCandidates(), eve::economy::MarketRegistry::loadFromJson(), eve::growth::SpeciesRegistry::loadFromJson(), eve::warship::WarshipRegistry::loadFunctionsFromJson(), eve::warship::WarshipRegistry::loadHullsFromJson(), eve::editor::ActionTimelineTarget::loadSnapshot(), eve::rpg::makeStatusTickSettlementRequest(), eve::schema::SchemaRegistry::migrateJson(), eve::transaction::AtomicBatch::parseCost(), eve::asset_import::gltf::parseDocument(), eve::asset::parseEvaManifest(), eve::rts::MissionScriptSystem::parseMonitorJson(), eve::parseSnapshotEnvelope(), eve::rts::MissionScriptSystem::parseTriggerJson(), eve::vehicle::parseVehicleDefinition(), eve::procgen::road::PreparedRoadGeometrySources::prepare(), eve::rpg::RPGSaveSession::prepareRestoreSnapshotJson(), eve::inventory::InventorySaveSession::prepareRestoreSnapshotJson(), eve::rts::RTS::prepareScriptUnit(), eve::asset_import::prepareShaderImport(), eve::asset_import::prepareUnityMaterial(), eve::asset_import::prepareUnityNativeMesh(), eve::asset_import::prepareUnityNativeTexture(), eve::asset_import::prepareUnrealM4Import(), eve::rts::RTS::queueScriptResearch(), eve::warship::WarshipSystem::rearrangeFromJson(), eve::vehicle::Vehicle::registerVehiclesFromJson(), eve::weapon::Weapon::registerWeaponsFromJson(), eve::climbing::ClimbingRuntime::reloadProfileJson(), eve::emergence::RuleEngine::replaceCatalogueJson(), eve::animation_editing::ControlRigDocument::replaceGraph(), eve::tactics::Tactics::replayJson(), eve::graphics::vulkan::Graphics::GuideCaptureService::requestCapture(), eve::rts::script_internal::resolveEffectDefinition(), eve::procgen::road::resolveRoadRecipeNetwork(), eve::orders::CommandQueue::restore(), eve::production::WorkQueue::restore(), eve::definitions::DefinitionRegistry::restoreJson(), eve::policyregistry::PolicyRegistry::restoreJson(), eve::procgen::GtsTerrainExportSettings::restoreJson(), eve::procgen::GtsTerrainMeshSettings::restoreJson(), eve::procgen::GtsTerrainLodSet::restoreJson(), eve::procgen::TerrainBiomePreset::restoreJson(), eve::procgen::TerrainGenerationSession::restoreJson(), eve::ui::PcgPhotoModeValues::restoreJson(), eve::emergence::FactStore::restoreJson(), eve::emergence::RuleEngine::restoreJson(), eve::scene::LocationProfile::restoreJson(), eve::climbing::ClimbingRuntime::restoreJson(), eve::rpg::GameState::restoreSnapshotJson(), eve::rpg::Tracker::restoreSnapshotJson(), eve::rts::RTS::sellScriptBuilding(), eve::dialogue::ConversationDocument::setField(), eve::effects::EffectPayload::setJson(), eve::orders::OrderPayload::setJson(), eve::climbing::ClimbingRuntime::setProfileJson(), eve::growth::GrowthCalendar::setSeasonLayoutFromJson(), eve::authority::Store::snapshot(), eve::definitions::DefinitionRegistry::snapshot(), eve::game_event::GameEventLog::snapshot(), eve::policyregistry::PolicyRegistry::snapshot(), eve::production::WorkQueue::snapshot(), eve::statepatch::Store::snapshot(), eve::transaction::Ledger::snapshot(), eve::emergence::RuleEngine::snapshotJson(), eve::rpg::RPGSaveSession::snapshotJson(), eve::rts::RTS::startScriptConstruction(), eve::rpg::ForgeBench::upgradeFromJson() , 以及 eve::map::validateMapObjects().

◆ getIf() [1/2]

template<class T >
const T * eve::Value::getIf ( ) const
inlinenoexcept

Return a typed pointer, or nullptr when the kind differs.

返回
Borrowed const pointer into this Value's variant storage. @ownership Borrowed; this Value owns the storage. @nullable Yes when T is not the active type. @lifetime Valid until this Value is destroyed, moved, or assigned a different kind. @thread Affine to this Value; no synchronization. @reentrancy Does not invoke callbacks.

在文件 Value.h 第 209 行定义.

被这些函数引用 eve::dev::PlayTraceBuffer::append(), eve::condition::authorityAllowScope(), eve::scene_editor::SceneEditorSession::checkRelationPlacement(), eve::scene_editor::ScriptComponentOperationTarget::cloneDomainState(), eve::weapon::compileSpellFragments(), eve::asset::cookCanonicalPcgGraph(), eve::climbing::decodeClimbingActionDefinition(), eve::climbing::decodeClimbingAnchorGraphDefinition(), eve::climbing::decodeClimbingProfileDefinition(), eve::production::WorkQueue::enqueue(), eve::physics::ClothModel::fromValue(), eve::physics::GeometryCollectionAsset::fromValue(), eve::physics::GeometryCollectionInstanceSnapshot::fromValue(), eve::action::ActionTimeline::fromValue(), eve::animation::DynamicBoneConfig::fromValue(), eve::asset_procgen::EvpackPointGraphLoader::load(), eve::asset_procgen::EvpackInstanceSetLoader::load(), eve::asset_procgen::EvpackTerrainMaterialLoader::load(), eve::asset_scene::EvpackSceneTemplateLoader::load(), eve::rts::RTSContentLoader::load(), eve::economy::MarketRegistry::loadFromJson(), eve::growth::SpeciesRegistry::loadFromJson(), eve::physics::snapshot_detail::migratePlanarV2(), eve::physics::snapshot_detail::parseBody3D(), eve::building::codec::parseEdgeCurve(), eve::asset::parseEvaManifest(), eve::asset_import::prepareGltfImport(), eve::asset_import::prepareUnrealM4Import(), eve::physics::snapshot_detail::prepareWorld2D(), eve::vehicle::Vehicle::registerVehiclesFromJson(), eve::asset_import::gltf::resolveBuffers(), eve::physics::World::restore(), eve::physics::World3D::restore(), eve::climbing::ClimbingRuntime::restore(), eve::orders::CommandQueue::restore(), eve::physics::WorldSnapshotAccess::restoreJoints2D(), eve::definitions::DefinitionRegistry::restoreJson(), eve::policyregistry::PolicyRegistry::restoreJson(), eve::GameSaveSession::restoreJson(), eve::physics::WorldSnapshotAccess::restoreShapeContact(), eve::rpg::GameState::restoreSnapshotJson(), eve::graphics::GraphicsArtifactProvider::restoreState(), eve::physics::PhysicsArtifactProvider::restoreState(), eve::growth::GrowthCalendar::setSeasonLayoutFromJson() , 以及 eve::map::validateMapObjects().

◆ getIf() [2/2]

template<class T >
T * eve::Value::getIf ( )
inlinenoexcept

Return a mutable typed pointer, or nullptr when the kind differs.

返回
Borrowed mutable pointer into this Value's variant storage. @ownership Borrowed; this Value owns the storage. @nullable Yes when T is not the active type. @lifetime Valid until this Value is destroyed, moved, or assigned a different kind. @thread Affine to this Value; no synchronization. @reentrancy Does not invoke callbacks.

在文件 Value.h 第 223 行定义.

◆ integer()

static Value eve::Value::integer ( std::int64_t  value)
inlinestatic

Compatibility factory for an Int64 value.

在文件 Value.h 第 115 行定义.

引用了 value.

被这些函数引用 eve::dnut::SequenceRuntime::captureState(), eve::snapshotScriptComponents(), eve::toCanonicalStateValue() , 以及 eve::dialogue::toCanonicalValue().

◆ isArray()

◆ isBool()

bool eve::Value::isBool ( ) const
inlinenoexcept

Return true when this value is a boolean.

在文件 Value.h 第 100 行定义.

引用了 type.

被这些函数引用 eve::statepatch::StatePatchStateAdapter::hasTag(), eve::asset_procgen::EvpackInstanceSetLoader::load(), eve::dnut::SequenceRuntime::restoreState() , 以及 toString().

◆ isDouble()

bool eve::Value::isDouble ( ) const
inlinenoexcept

Return true when this value is a Double.

在文件 Value.h 第 104 行定义.

引用了 type.

被这些函数引用 eve::action::ActionTimeline::fromValue(), eve::hexmap::hexTerrainBakeFromValue(), eve::asset_procgen::EvpackTerrainMaterialLoader::load() , 以及 toString().

◆ isInt64()

◆ isNull()

bool eve::Value::isNull ( ) const
inlinenoexcept

Return true when this value is null.

在文件 Value.h 第 98 行定义.

引用了 type.

被这些函数引用 eve::condition::encodeCondition(), eve::physics::ClothModel::fromValue(), eve::climbing::ClimbingRuntime::restore() , 以及 eve::dev::writeActionGuideVerifyEvidence().

◆ isNumeric()

bool eve::Value::isNumeric ( ) const
inlinenoexcept

Return whether this value is an integer or finite number.

在文件 Value.h 第 188 行定义.

被这些函数引用 eve::hexmap::hexTerrainBakeFromValue(), eve::inventory::InventorySaveSession::prepareRestoreSnapshotJson() , 以及 eve::rpg::Tracker::restoreSnapshotJson().

◆ isObject()

◆ isString()

◆ keys()

std::vector< std::string > eve::Value::keys ( ) const

Return object member names in deterministic order.

在文件 Value.cpp 第 258 行定义.

引用了 key, object, result , 以及 value.

被这些函数引用 eve::dialogue::lintConversationWorkspace() , 以及 eve::dnut::SequenceRuntime::start().

◆ kind()

Type eve::Value::kind ( ) const
inlinenoexcept

Compatibility spelling for the former dialogue data tree.

在文件 Value.h 第 96 行定义.

引用了 type.

被这些函数引用 eve::condition::encodeCondition().

◆ null()

static Value eve::Value::null ( )
inlinestatic

Compatibility factory for a null value.

在文件 Value.h 第 113 行定义.

被这些函数引用 eve::dev::Snapshot::restoreState(), eve::toCanonicalStateValue() , 以及 eve::dialogue::toCanonicalValue().

◆ number()

static Value eve::Value::number ( double  value)
inlinestatic

Compatibility factory for a Double value.

在文件 Value.h 第 117 行定义.

引用了 value.

被这些函数引用 eve::rpg::captureRpgState(), eve::toCanonicalStateValue() , 以及 eve::dialogue::toCanonicalValue().

◆ object() [1/2]

◆ object() [2/2]

Value eve::Value::object ( std::initializer_list< Object::value_type >  members)
static

Copy members into an owning object with lexicographically ordered keys.

参数
membersBorrowed members, copied before return; duplicate keys keep the first entry.
返回
Independent object value; no references to members are retained. @cost Map insertion plus recursive value copies, once per construction. @thread No shared mutable state; inputs must remain stable during the call. @reentrancy Does not invoke callbacks.

在文件 Value.cpp 第 131 行定义.

引用了 members , 以及 Value().

◆ operator=() [1/2]

Value & eve::Value::operator= ( const Value &  other)
default

Replace this payload with a recursive copy.

◆ operator=() [2/2]

Value & eve::Value::operator= ( Value &&  other)
defaultnoexcept

Replace this payload by moving ownership.

◆ operator==()

bool eve::Value::operator== ( const Value &  other) const

Compare two values recursively, including their numeric kinds.

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

◆ pushBack()

void eve::Value::pushBack ( Value  value)

Append an element to an array value.

在文件 Value.cpp 第 214 行定义.

引用了 array(), EV_ASSERT , 以及 value.

被这些函数引用 eve::animation::encodeControlRig() , 以及 eve::executeGameplayControlRequest().

◆ set()

◆ storage() [1/2]

const Storage & eve::Value::storage ( ) const
inlinenoexcept

Return the immutable variant storage for visitors.

在文件 Value.h 第 195 行定义.

◆ storage() [2/2]

Storage & eve::Value::storage ( )
inlinenoexcept

Return mutable variant storage for owning edits.

在文件 Value.h 第 197 行定义.

◆ string()

◆ toJson()

Result< std::string > eve::Value::toJson ( ) const

Serialize this value as deterministic compact JSON.

返回
JSON text, or a SerializationError for NaN or infinity.
备注
Object keys are emitted in lexicographic order. Non-finite Double values are intentionally rejected rather than silently converted to null.

在文件 Value.cpp 第 187 行定义.

引用了 eve::json::stringify().

被这些函数引用 eve::rpg::Party::checkpointJson(), eve::rpg::RPGActor::checkpointJson(), eve::asset::cookCanonicalPcgGraph(), eve::asset::cookCanonicalVolumeTextureRgba8(), eve::editor::exposeActionTimelineScriptBindings(), eve::avatar::exposeAppearance(), eve::schema::SchemaRegistry::generateBindingContract(), eve::rpg::QuestGenerator::generateJson(), eve::dialogue::ConversationDocument::getField(), eve::editor::ActionTimelineWidget::inspectSelection(), eve::schema::SchemaRegistry::migrate(), eve::asset_import::structured_detail::packageModel(), eve::rpg::RpgStorySession::Impl::persistProgress(), eve::asset_import::prepareGltfImport(), eve::asset_import::prepareImageImport(), eve::asset_import::prepareLegacyAnimationImport(), eve::procgen_editing::RoadPresetDocument::prepareRestore(), eve::rpg::RPGSaveSession::prepareRestoreSnapshotJson(), eve::asset_import::prepareUnityNativeMesh(), eve::asset_import::prepareUnityNativeVolumeTexture(), eve::asset_import::prepareUnityVegetationMaterial(), eve::asset::serializeEvaManifest(), eve::scene::LocationProfile::serializeJson(), eve::orders::CommandQueue::snapshot(), eve::definitions::DefinitionRegistry::snapshotJson(), eve::emergence::FactStore::snapshotJson(), eve::emergence::RuleEngine::snapshotJson(), eve::inventory::InventorySaveSession::snapshotJson(), eve::policyregistry::PolicyRegistry::snapshotJson(), eve::procgen::TerrainSpawnPlan::snapshotJson(), eve::rpg::GameState::snapshotJson(), eve::rpg::Tracker::snapshotJson(), eve::effects::EffectPayload::toJson(), eve::orders::OrderPayload::toJson(), eve::physics::ClothModel::toJson(), eve::stylize::AttackVfxSkin::toJson(), eve::stylize::AttackVfxRecipe::toJson(), eve::stylize::MeshVfxAsset::toJson(), eve::dev::writeActionGuideArtifactPack() , 以及 eve::dev::writeActionGuideVerifyEvidence().

◆ toString()

std::string eve::Value::toString ( ) const

Render a scalar using the former dialogue formatting rules.

在文件 Value.cpp 第 283 行定义.

引用了 asBool(), asDouble(), asInt(), asString(), buffer, isBool(), isDouble(), isInt64() , 以及 isString().

◆ type()

◆ typeName()

std::string eve::Value::typeName ( ) const

Return the compatibility type name used by dialogue scripts.

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

引用了 Array, Bool, Double, Int64, Null, Object, String , 以及 type().

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


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