yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
story_event_graph_navigation.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_ORACLE_STORY_EVENT_GRAPH_NAVIGATION_H
2#define YAZE_APP_EDITOR_ORACLE_STORY_EVENT_GRAPH_NAVIGATION_H
3
4#include <optional>
5
6#include "zelda3/common.h"
7
8namespace yaze::editor {
9
10inline bool IsValidOverworldMapJumpTarget(int map_id) {
11 return map_id >= 0 && map_id < zelda3::kNumOverworldMaps;
12}
13
14inline std::optional<int> ResolveStoryLocationMapJumpTarget(
15 const std::optional<int>& overworld_id,
16 const std::optional<int>& special_world_id) {
17 if (overworld_id.has_value() &&
18 IsValidOverworldMapJumpTarget(*overworld_id)) {
19 return overworld_id;
20 }
21 if (special_world_id.has_value() &&
22 IsValidOverworldMapJumpTarget(*special_world_id)) {
23 return special_world_id;
24 }
25 return std::nullopt;
26}
27
28} // namespace yaze::editor
29
30#endif // YAZE_APP_EDITOR_ORACLE_STORY_EVENT_GRAPH_NAVIGATION_H
Editors are the view controllers for the application.
bool IsValidOverworldMapJumpTarget(int map_id)
std::optional< int > ResolveStoryLocationMapJumpTarget(const std::optional< int > &overworld_id, const std::optional< int > &special_world_id)
constexpr int kNumOverworldMaps
Definition common.h:85