载入中...
搜索中...
未找到
eve::building::AssemblyService类 参考

Canonical house composition, blueprint and persistence operations. @thread World/registry owner-thread only. Inputs are synchronous borrows, never retained. @reentrancy Validation rules must be pure; committed events observe complete world state. @ownership Worlds own members and assembly records; all results own their payloads. 更多...

#include <BuildingAssembly.h>

静态 Public 成员函数

static Result< BuildingBlueprint > capture (const PlacementWorld &world, std::span< const int > members, eve::AssetGuid id, AssemblyPose origin)
 Capture an explicit, structurally closed selection relative to a grid vertex. @cost Copies selected members and their definition values once per capture; never per frame.
 
static Result< PreparedAssembly > preparePlacement (const PlacementWorld &world, const BuildingBlueprint &blueprint, AssemblyId id, AssemblyPose pose)
 Prepare one complete instance of a pinned blueprint in the target world. @cost Copies world/house state once per pose change; dense free collisions can be quadratic; reuse preview.
 
static Result< PreparedAssembly > prepareMove (const PlacementWorld &world, AssemblyId id, AssemblyPose pose)
 Prepare a rigid move of the current members, including instance modifications. @cost One whole-world candidate per completed gesture; not a per-frame setter.
 
static Result< PreparedAssembly > prepareRemoval (const PlacementWorld &world, AssemblyId id)
 Prepare removal of all house members, rejecting external structural dependents. @cost One whole-world candidate per removal gesture.
 
static Result< PreparedAssembly > prepareRemodel (const PlacementWorld &world, AssemblyId id, std::span< const PlacedBuilding > members)
 Prepare replacement of a house's complete member set for independent remodelling.
 
static Result< AssemblyReceipt > commit (PlacementWorld &world, PreparedAssembly token)
 Consume a prepared operation if world and definition preconditions still match. @cost Compares owning world state once per commit, then publishes a single state exchange.
 
static Result< BuildingAssembly > assembly (const PlacementWorld &world, AssemblyId id)
 Query an owning membership snapshot, or NotFound; caller-thread only.
 
static Result< BuildingAssembly > resolve (const PlacementWorld &world, AssemblyHandle handle)
 Resolve a handle only in its owning world/epoch/generation; owning result.
 
static Result< AssemblyHandle > handle (const PlacementWorld &world, AssemblyId id)
 Return a checked runtime handle for a currently live persistent house.
 
static std::optional< AssemblyId > owner (const PlacementWorld &world, int member)
 Return a member's house identity, or no value for an ungrouped instance.
 
static std::vector< AssemblyId > assemblies (const PlacementWorld &world)
 Return an owning, stable-order house list for UI and persistence.
 
static Result< Value > encodeBlueprint (const BuildingBlueprint &blueprint)
 Encode a blueprint in the versioned canonical schema. @cost Copies and validates all parts and curve links once per save/export; curve matching can be quadratic.
 
static Result< BuildingBlueprint > decodeBlueprint (const Value &value)
 Validate and decode an untrusted blueprint without publishing state. @cost Validates all parts/dependencies once per import; exact curve/member matching can be quadratic.
 
static Result< Value > snapshotWorld (const PlacementWorld &world)
 Capture the complete logical world, including grid, terrain, curves and assemblies. @cost Linear owning copy of world cells and members, once per save or transaction boundary.
 
static Result< void > restoreWorld (PlacementWorld &world, const Value &value)
 Validate and stage a complete saved world; failure preserves the old world. @cost Builds a complete replacement world once per load; all old runtime handles expire.
 
static Result< void > applyReceipt (PlacementWorld &world, const Value &expected, const Value &desired)
 Apply a receipt endpoint only when the current world matches the expected endpoint. @cost Complete world comparison and candidate restore, once per undo/redo.
 

详细描述

Canonical house composition, blueprint and persistence operations. @thread World/registry owner-thread only. Inputs are synchronous borrows, never retained. @reentrancy Validation rules must be pure; committed events observe complete world state. @ownership Worlds own members and assembly records; all results own their payloads.

在文件 BuildingAssembly.h 第 102 行定义.

成员函数说明

◆ applyReceipt()

Result< void > eve::building::AssemblyService::applyReceipt ( PlacementWorld &  world,
const Value &  expected,
const Value &  desired 
)
static

Apply a receipt endpoint only when the current world matches the expected endpoint. @cost Complete world comparison and candidate restore, once per undo/redo.

在文件 BuildingAssemblyPersistence.cpp 第 302 行定义.

引用了 eve::Conflict, current , 以及 w.

被这些函数引用 eve::building_editing::BuildingAssemblyTarget::applyDomainOperation() , 以及 eve::building_editing::BuildingAssemblyTarget::commitDomainState().

◆ assemblies()

std::vector< AssemblyId > eve::building::AssemblyService::assemblies ( const PlacementWorld &  world)
static

Return an owning, stable-order house list for UI and persistence.

在文件 BuildingAssembly.cpp 第 287 行定义.

引用了 a, result , 以及 w.

◆ assembly()

Result< BuildingAssembly > eve::building::AssemblyService::assembly ( const PlacementWorld &  world,
AssemblyId  id 
)
static

Query an owning membership snapshot, or NotFound; caller-thread only.

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

引用了 w.

◆ capture()

Result< BuildingBlueprint > eve::building::AssemblyService::capture ( const PlacementWorld &  world,
std::span< const int >  members,
eve::AssetGuid  id,
AssemblyPose  origin 
)
static

Capture an explicit, structurally closed selection relative to a grid vertex. @cost Copies selected members and their definition values once per capture; never per frame.

返回
Owning recipe or diagnostics; does not change the world or allocate instance ids.

在文件 BuildingAssembly.cpp 第 44 行定义.

引用了 b, eve::building::assembly_detail::checkGrid(), curve, eve::building::assembly_detail::definitionValue(), eve::building::codec::EdgeCurvePayload::group, id, eve::building::BuildingBlueprint::id, key, local, member, members, origin, p, payload, remap, eve::building::assembly_detail::transformPart() , 以及 w.

◆ commit()

Result< AssemblyReceipt > eve::building::AssemblyService::commit ( PlacementWorld &  world,
PreparedAssembly  token 
)
static

Consume a prepared operation if world and definition preconditions still match. @cost Compares owning world state once per commit, then publishes a single state exchange.

返回
Exact reversible receipt; stale token returns Conflict without mutation.

在文件 BuildingAssembly.cpp 第 236 行定义.

引用了 eve::building::BuildingChangeEvent::action, eve::building::assembly_detail::checkDefinitions(), current, eve::building::assembly_detail::nextEpoch(), t, token, valid, w , 以及 eve::building::BuildingChangeEvent::worldId.

被这些函数引用 eve::building_editing::BuildingAssemblyTarget::makeOperation().

◆ decodeBlueprint()

Result< BuildingBlueprint > eve::building::AssemblyService::decodeBlueprint ( const Value &  value)
static

Validate and decode an untrusted blueprint without publishing state. @cost Validates all parts/dependencies once per import; exact curve/member matching can be quadratic.

在文件 BuildingAssemblyPersistence.cpp 第 95 行定义.

引用了 b, c, eve::building::assembly_detail::checkDefinitions(), eve::Conflict, curve, found, eve::building::BuildingBlueprint::id, key, number, p, required, eve::Result< T >::success() , 以及 v.

◆ encodeBlueprint()

Result< Value > eve::building::AssemblyService::encodeBlueprint ( const BuildingBlueprint &  blueprint)
static

Encode a blueprint in the versioned canonical schema. @cost Copies and validates all parts and curve links once per save/export; curve matching can be quadratic.

在文件 BuildingAssemblyPersistence.cpp 第 77 行定义.

引用了 b, p , 以及 parts.

◆ handle()

Result< AssemblyHandle > eve::building::AssemblyService::handle ( const PlacementWorld &  world,
AssemblyId  id 
)
static

Return a checked runtime handle for a currently live persistent house.

在文件 BuildingAssembly.cpp 第 269 行定义.

引用了 w.

◆ owner()

std::optional< AssemblyId > eve::building::AssemblyService::owner ( const PlacementWorld &  world,
int  member 
)
static

Return a member's house identity, or no value for an ungrouped instance.

在文件 BuildingAssembly.cpp 第 281 行定义.

引用了 a, id, key, m, member , 以及 w.

◆ prepareMove()

Result< PreparedAssembly > eve::building::AssemblyService::prepareMove ( const PlacementWorld &  world,
AssemblyId  id,
AssemblyPose  pose 
)
static

Prepare a rigid move of the current members, including instance modifications. @cost One whole-world candidate per completed gesture; not a per-frame setter.

在文件 BuildingAssembly.cpp 第 153 行定义.

引用了 curve, key, m, member, p, pose, remap, eve::building::assembly_detail::transformPart() , 以及 w.

◆ preparePlacement()

Result< PreparedAssembly > eve::building::AssemblyService::preparePlacement ( const PlacementWorld &  world,
const BuildingBlueprint &  blueprint,
AssemblyId  id,
AssemblyPose  pose 
)
static

Prepare one complete instance of a pinned blueprint in the target world. @cost Copies world/house state once per pose change; dense free collisions can be quadratic; reuse preview.

返回
Move-only commit token; any failure leaves world, ids and events untouched.

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

引用了 a, b, c, curve, id, eve::building::BuildingAssembly::id, p, pose, remap, eve::building::assembly_detail::transformPart() , 以及 w.

◆ prepareRemodel()

Result< PreparedAssembly > eve::building::AssemblyService::prepareRemodel ( const PlacementWorld &  world,
AssemblyId  id,
std::span< const PlacedBuilding >  members 
)
static

Prepare replacement of a house's complete member set for independent remodelling.

参数
membersExact desired world-space members; zero instanceId allocates a new member. @cost Copies a world and validates its final state once per edit gesture.

在文件 BuildingAssembly.cpp 第 185 行定义.

引用了 a, key, member, members, p , 以及 w.

◆ prepareRemoval()

Result< PreparedAssembly > eve::building::AssemblyService::prepareRemoval ( const PlacementWorld &  world,
AssemblyId  id 
)
static

Prepare removal of all house members, rejecting external structural dependents. @cost One whole-world candidate per removal gesture.

在文件 BuildingAssembly.cpp 第 175 行定义.

引用了 a, key, member , 以及 w.

◆ resolve()

Result< BuildingAssembly > eve::building::AssemblyService::resolve ( const PlacementWorld &  world,
AssemblyHandle  handle 
)
static

Resolve a handle only in its owning world/epoch/generation; owning result.

在文件 BuildingAssembly.cpp 第 274 行定义.

引用了 h, slot , 以及 w.

◆ restoreWorld()

Result< void > eve::building::AssemblyService::restoreWorld ( PlacementWorld &  world,
const Value &  value 
)
static

Validate and stage a complete saved world; failure preserves the old world. @cost Builds a complete replacement world once per load; all old runtime handles expire.

在文件 BuildingAssemblyPersistence.cpp 第 290 行定义.

引用了 eve::building::BuildingChangeEvent::action, eve::Conflict, eve::Result< T >::success(), v, w , 以及 eve::building::BuildingChangeEvent::worldId.

◆ snapshotWorld()

Result< Value > eve::building::AssemblyService::snapshotWorld ( const PlacementWorld &  world)
static

Capture the complete logical world, including grid, terrain, curves and assemblies. @cost Linear owning copy of world cells and members, once per save or transaction boundary.

在文件 BuildingAssemblyPersistence.cpp 第 143 行定义.

引用了 a, eve::building::assembly_detail::checkGrid(), g, key, member, members, terrain, value, w, x , 以及 y.

被这些函数引用 eve::building_editing::BuildingAssemblyTarget::cloneDomainState() , 以及 eve::building_editing::BuildingAssemblyTarget::commitDomainState().


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