The complete Oracle narrative progression graph. More...
#include <story_event_graph.h>
Public Member Functions | |
| StoryEventGraph ()=default | |
| absl::Status | LoadFromJson (const std::string &path) |
| Load the graph from a JSON file. | |
| absl::Status | LoadFromString (const std::string &json_content) |
| Load the graph from a JSON string. | |
| bool | loaded () const |
| Check if the graph has been loaded. | |
| void | AutoLayout () |
| Compute layout positions using topological sort + layered positioning. | |
| void | UpdateStatus (uint8_t crystal_bitfield, uint8_t game_state) |
| Update node completion status based on SRAM state. | |
| void | UpdateStatus (const OracleProgressionState &state) |
| Update node completion status based on Oracle progression state. | |
| std::vector< std::string > | GetCompletedNodes (uint8_t crystal_bitfield, uint8_t game_state) const |
| Get IDs of events that are completed based on SRAM state. | |
| std::vector< std::string > | GetCompletedNodes (const OracleProgressionState &state) const |
| Get IDs of events that are completed based on Oracle progression state. | |
| const std::vector< StoryEventNode > & | nodes () const |
| const std::vector< StoryEdge > & | edges () const |
| const StoryEventNode * | GetNode (const std::string &id) const |
Private Attributes | |
| std::vector< StoryEventNode > | nodes_ |
| std::vector< StoryEdge > | edges_ |
| std::unordered_map< std::string, size_t > | node_index_ |
The complete Oracle narrative progression graph.
Loaded from story_events.json in the Oracle code folder. Used by the StoryEventGraphPanel to render an interactive node graph colored by SRAM completion state.
Usage: StoryEventGraph graph; auto status = graph.LoadFromJson(path); if (status.ok()) { graph.AutoLayout(); graph.UpdateStatus(crystal_bitfield, game_state); // Render nodes with graph.nodes() }
Definition at line 129 of file story_event_graph.h.
|
default |
| absl::Status yaze::core::StoryEventGraph::LoadFromJson | ( | const std::string & | path | ) |
Load the graph from a JSON file.
Definition at line 192 of file story_event_graph.cc.
References LoadFromString().
Referenced by yaze::core::HackManifest::LoadProjectRegistry().

| absl::Status yaze::core::StoryEventGraph::LoadFromString | ( | const std::string & | json_content | ) |
Load the graph from a JSON string.
Definition at line 202 of file story_event_graph.cc.
References yaze::core::StoryEventNode::completed_when, yaze::core::StoryEventNode::dependencies, edges_, yaze::core::StoryEventNode::evidence, yaze::core::StoryEventNode::flags, yaze::core::StoryEdge::from, yaze::core::StoryEventNode::id, yaze::core::StoryEventNode::last_verified, yaze::core::StoryEventNode::locations, yaze::core::StoryEventNode::name, node_index_, nodes_, yaze::core::StoryEventNode::notes, RETURN_IF_ERROR, yaze::core::StoryEventNode::scripts, yaze::core::StoryEventNode::text_ids, yaze::core::StoryEdge::to, yaze::core::StoryEdge::type, and yaze::core::StoryEventNode::unlocks.
Referenced by LoadFromJson().
|
inline |
Check if the graph has been loaded.
Definition at line 146 of file story_event_graph.h.
References nodes_.
Referenced by yaze::core::HackManifest::ClearOracleProgressionState(), yaze::core::HackManifest::HasProjectRegistry(), and yaze::core::HackManifest::SetOracleProgressionState().
| void yaze::core::StoryEventGraph::AutoLayout | ( | ) |
Compute layout positions using topological sort + layered positioning.
Places nodes in horizontal layers based on dependency depth. Within each layer, nodes are spaced vertically.
Definition at line 336 of file story_event_graph.cc.
References edges_, and nodes_.
Referenced by yaze::core::HackManifest::LoadProjectRegistry().
| void yaze::core::StoryEventGraph::UpdateStatus | ( | uint8_t | crystal_bitfield, |
| uint8_t | game_state ) |
Update node completion status based on SRAM state.
Determines which events are completed, available, or locked based on the crystal bitfield and game state.
Definition at line 485 of file story_event_graph.cc.
References yaze::core::OracleProgressionState::crystal_bitfield, yaze::core::OracleProgressionState::game_state, and UpdateStatus().
Referenced by yaze::core::HackManifest::ClearOracleProgressionState(), yaze::core::HackManifest::LoadProjectRegistry(), yaze::core::HackManifest::SetOracleProgressionState(), and UpdateStatus().

| void yaze::core::StoryEventGraph::UpdateStatus | ( | const OracleProgressionState & | state | ) |
Update node completion status based on Oracle progression state.
Definition at line 493 of file story_event_graph.cc.
References GetCompletedNodes(), yaze::core::kAvailable, yaze::core::kCompleted, yaze::core::kLocked, and nodes_.

| std::vector< std::string > yaze::core::StoryEventGraph::GetCompletedNodes | ( | uint8_t | crystal_bitfield, |
| uint8_t | game_state ) const |
Get IDs of events that are completed based on SRAM state.
Definition at line 520 of file story_event_graph.cc.
References yaze::core::OracleProgressionState::crystal_bitfield, yaze::core::OracleProgressionState::game_state, and GetCompletedNodes().
Referenced by GetCompletedNodes(), and UpdateStatus().

| std::vector< std::string > yaze::core::StoryEventGraph::GetCompletedNodes | ( | const OracleProgressionState & | state | ) | const |
Get IDs of events that are completed based on Oracle progression state.
Definition at line 528 of file story_event_graph.cc.
References yaze::core::OracleProgressionState::crystal_bitfield, yaze::core::OracleProgressionState::game_state, and nodes_.
|
inline |
Definition at line 184 of file story_event_graph.h.
References nodes_.
Referenced by yaze::core::HackManifest::LoadProjectRegistry(), and yaze::editor::StoryEventGraphPanel::UpdateFilterCache().
|
inline |
Definition at line 188 of file story_event_graph.h.
References edges_.
Referenced by yaze::core::HackManifest::LoadProjectRegistry().
| const StoryEventNode * yaze::core::StoryEventGraph::GetNode | ( | const std::string & | id | ) | const |
Definition at line 597 of file story_event_graph.cc.
References node_index_, and nodes_.
Referenced by yaze::editor::StoryEventGraphPanel::DrawNodeDetail().
|
private |
Definition at line 193 of file story_event_graph.h.
Referenced by AutoLayout(), GetCompletedNodes(), GetNode(), loaded(), LoadFromString(), nodes(), and UpdateStatus().
|
private |
Definition at line 194 of file story_event_graph.h.
Referenced by AutoLayout(), edges(), and LoadFromString().
|
private |
Definition at line 195 of file story_event_graph.h.
Referenced by GetNode(), and LoadFromString().