Caller-owned Pcg location and bookmark state. Mutable operations validate complete candidate data before publication. No scene objects are retained. 更多...
#include <LocationProfile.h>
Public 成员函数 | |
| Result< void > | saveLocation (const LocationPose &camera, const std::optional< LocationPose > &player=std::nullopt) |
| Save the one-shot startup location, replacing the previous value atomically. | |
| Result< LocationSnapshot > | loadLocation () |
| Consume the startup location and clear hasSaved exactly once, matching Pcg LoadLocation. | |
| bool | hasSavedLocation () const noexcept |
| Whether a startup location is waiting to be consumed. | |
| Result< int > | addBookmark (LocationBookmark bookmark) |
| Add a uniquely named bookmark and return its index. | |
| Result< void > | overrideBookmark (int index, const LocationSnapshot &snapshot, std::string controller, std::string scene) |
| Replace one bookmark while preserving its existing name. | |
| Result< int > | removeBookmark (int index, int selectedIndex) |
| Remove one bookmark and return Pcg's adjusted selected index. | |
| Result< LocationSnapshot > | loadBookmark (int index) const |
| Copy a bookmark transform snapshot. | |
| Result< int > | previousBookmark (int selectedIndex) const |
| Return the previous wrapped selection, or NotFound for an empty profile. | |
| Result< int > | nextBookmark (int selectedIndex) const |
| Return the next wrapped selection, or NotFound for an empty profile. | |
| void | clearBookmarks () noexcept |
| Remove every bookmark. | |
| int | getBookmarkCount () const noexcept |
| Returns the bookmark count. | |
| Result< std::string > | getBookmarkName (int index) const |
| Copy a bookmark name, or return InvalidArgument for an invalid index. | |
| Result< std::string > | getBookmarkController (int index) const |
| Copy a bookmark controller name, or return InvalidArgument for an invalid index. | |
| Result< std::string > | getBookmarkScene (int index) const |
| Copy a bookmark scene name, or return InvalidArgument for an invalid index. | |
| Result< std::string > | serializeJson () const |
Serialize schema eve.scene.location-profile version 1 as deterministic JSON. | |
| Result< void > | restoreJson (std::string_view json) |
| Atomically restore schema version 1 JSON. | |
| const LocationBookmark * | bookmarkAt (int index) const noexcept |
| Borrow one bookmark. | |
详细描述
Caller-owned Pcg location and bookmark state. Mutable operations validate complete candidate data before publication. No scene objects are retained.
在文件 LocationProfile.h 第 40 行定义.
成员函数说明
◆ addBookmark()
| Result< int > eve::scene::LocationProfile::addBookmark | ( | LocationBookmark | bookmark | ) |
Add a uniquely named bookmark and return its index.
在文件 LocationProfile.cpp 第 84 行定义.
引用了 eve::scene::LocationBookmark::camera, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), finite, eve::scene::LocationBookmark::name, eve::scene::LocationBookmark::player, eve::Result< T >::success() , 以及 value.
被这些函数引用 restoreJson().
◆ bookmarkAt()
|
noexcept |
Borrow one bookmark.
- 返回
- Non-owning pointer valid until this profile's next bookmark mutation, or null for an invalid index. @ownership The profile retains ownership; callers must not store the pointer across mutations or threads.
在文件 LocationProfile.cpp 第 148 行定义.
引用了 index.
被这些函数引用 getBookmarkController(), getBookmarkName(), getBookmarkScene() , 以及 loadBookmark().
◆ clearBookmarks()
|
inlinenoexcept |
Remove every bookmark.
在文件 LocationProfile.h 第 64 行定义.
◆ getBookmarkController()
| Result< std::string > eve::scene::LocationProfile::getBookmarkController | ( | int | index | ) | const |
Copy a bookmark controller name, or return InvalidArgument for an invalid index.
在文件 LocationProfile.cpp 第 158 行定义.
引用了 bookmarkAt(), eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::Result< T >::success() , 以及 value.
◆ getBookmarkCount()
|
inlinenoexcept |
Returns the bookmark count.
在文件 LocationProfile.h 第 66 行定义.
被这些函数引用 nextBookmark(), overrideBookmark(), previousBookmark() , 以及 removeBookmark().
◆ getBookmarkName()
| Result< std::string > eve::scene::LocationProfile::getBookmarkName | ( | int | index | ) | const |
Copy a bookmark name, or return InvalidArgument for an invalid index.
在文件 LocationProfile.cpp 第 152 行定义.
引用了 bookmarkAt(), eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::Result< T >::success() , 以及 value.
◆ getBookmarkScene()
| Result< std::string > eve::scene::LocationProfile::getBookmarkScene | ( | int | index | ) | const |
Copy a bookmark scene name, or return InvalidArgument for an invalid index.
在文件 LocationProfile.cpp 第 164 行定义.
引用了 bookmarkAt(), eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::Result< T >::success() , 以及 value.
◆ hasSavedLocation()
|
inlinenoexcept |
Whether a startup location is waiting to be consumed.
在文件 LocationProfile.h 第 48 行定义.
◆ loadBookmark()
| Result< LocationSnapshot > eve::scene::LocationProfile::loadBookmark | ( | int | index | ) | const |
Copy a bookmark transform snapshot.
在文件 LocationProfile.cpp 第 122 行定义.
引用了 bookmarkAt(), eve::scene::LocationSnapshot::camera, eve::Diagnostic::error(), eve::Result< T >::failure(), index , 以及 eve::Result< T >::success().
◆ loadLocation()
| Result< LocationSnapshot > eve::scene::LocationProfile::loadLocation | ( | ) |
Consume the startup location and clear hasSaved exactly once, matching Pcg LoadLocation.
在文件 LocationProfile.cpp 第 75 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::NotFound , 以及 eve::Result< T >::success().
◆ nextBookmark()
| Result< int > eve::scene::LocationProfile::nextBookmark | ( | int | selectedIndex | ) | const |
Return the next wrapped selection, or NotFound for an empty profile.
在文件 LocationProfile.cpp 第 139 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), getBookmarkCount(), eve::NotFound , 以及 eve::Result< T >::success().
◆ overrideBookmark()
| Result< void > eve::scene::LocationProfile::overrideBookmark | ( | int | index, |
| const LocationSnapshot & | snapshot, | ||
| std::string | controller, | ||
| std::string | scene | ||
| ) |
Replace one bookmark while preserving its existing name.
在文件 LocationProfile.cpp 第 96 行定义.
引用了 eve::scene::LocationSnapshot::camera, eve::Diagnostic::error(), eve::Result< T >::failure(), getBookmarkCount(), index, eve::scene::LocationSnapshot::player, scene , 以及 eve::Result< T >::success().
◆ previousBookmark()
| Result< int > eve::scene::LocationProfile::previousBookmark | ( | int | selectedIndex | ) | const |
Return the previous wrapped selection, or NotFound for an empty profile.
在文件 LocationProfile.cpp 第 130 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), getBookmarkCount(), eve::NotFound , 以及 eve::Result< T >::success().
◆ removeBookmark()
| Result< int > eve::scene::LocationProfile::removeBookmark | ( | int | index, |
| int | selectedIndex | ||
| ) |
Remove one bookmark and return Pcg's adjusted selected index.
在文件 LocationProfile.cpp 第 111 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), getBookmarkCount(), index , 以及 eve::Result< T >::success().
◆ restoreJson()
| Result< void > eve::scene::LocationProfile::restoreJson | ( | std::string_view | json | ) |
Atomically restore schema version 1 JSON.
- 参数
-
json Strict UTF-8 JSON; unknown fields are rejected.
- 备注
- The current profile remains unchanged when parsing or validation fails.
在文件 LocationProfile.cpp 第 184 行定义.
引用了 addBookmark(), camera, eve::scene::LocationBookmark::camera, eve::scene::LocationBookmark::controller, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Value::fromJson(), name, eve::scene::LocationBookmark::name, object, eve::ParseError, eve::scene::LocationBookmark::player, pose, root, scene, eve::scene::LocationBookmark::scene, eve::Result< T >::success() , 以及 value.
◆ saveLocation()
| Result< void > eve::scene::LocationProfile::saveLocation | ( | const LocationPose & | camera, |
| const std::optional< LocationPose > & | player = std::nullopt |
||
| ) |
Save the one-shot startup location, replacing the previous value atomically.
在文件 LocationProfile.cpp 第 66 行定义.
引用了 camera, eve::Diagnostic::error(), eve::Result< T >::failure() , 以及 eve::Result< T >::success().
◆ serializeJson()
| Result< std::string > eve::scene::LocationProfile::serializeJson | ( | ) | const |
Serialize schema eve.scene.location-profile version 1 as deterministic JSON.
在文件 LocationProfile.cpp 第 171 行定义.
引用了 root , 以及 eve::Value::toJson().
该类的文档由以下文件生成:
- src/modules/scene/LocationProfile.h
- src/modules/scene/LocationProfile.cpp