LeviLamina
Loading...
Searching...
No Matches
Router.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/oreui/routing/RouteHistoryAction.h"
7#include "mc/client/gui/oreui/routing/RouterAction.h"
8#include "mc/client/gui/oreui/routing/RouterHistory.h"
9#include "mc/client/gui/oreui/routing/RouterLocation.h"
10#include "mc/deps/core/utility/NonOwnerPointer.h"
11#include "mc/deps/core/utility/pub_sub/Publisher.h"
12
13// auto generated forward declare list
14// clang-format off
15class AbstractScene;
16class ISceneStack;
17namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
18namespace OreUI { class IRouteMatcher; }
19namespace OreUI { class IRoutePrerequisiteHandler; }
20namespace OreUI { class RouterEventing; }
21// clang-format on
22
23namespace OreUI {
24
25class Router {
26public:
27 // Router inner types declare
28 // clang-format off
30 // clang-format on
31
32 // Router inner types define
33 enum class RouterPushMode : int {
34 Normal = 0,
35 Flux = 1,
36 };
37
39 public:
40 // member variables
41 // NOLINTBEGIN
42 ::ll::TypedStorage<8, 160, ::std::optional<::OreUI::RouterLocation>> mOldLocation;
43 ::ll::TypedStorage<8, 160, ::std::optional<::OreUI::RouterLocation>> mCurrentLocation;
44 // NOLINTEND
45 };
46
47 using OnRouteChangedCallback = void(
48 ::std::optional<::OreUI::RouterLocation> const&,
49 ::std::optional<::OreUI::RouterLocation> const&,
50 ::OreUI::RouterAction
51 );
52
53public:
54 // member variables
55 // NOLINTBEGIN
56 ::ll::TypedStorage<8, 128, ::OreUI::RouterHistory> mHistory;
57 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::IRouteMatcher const>> mRouteMatcher;
58 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::ISceneStack>> mSceneStack;
59 ::ll::TypedStorage<
60 8,
61 128,
62 ::Bedrock::PubSub::Publisher<
63 void(
64 ::std::optional<::OreUI::RouterLocation> const&,
65 ::std::optional<::OreUI::RouterLocation> const&,
66 ::OreUI::RouterAction
67 ),
68 ::Bedrock::PubSub::ThreadModel::MultiThreaded,
69 0>>
70 mOnRouteChangedPublisher;
71 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::IRoutePrerequisiteHandler>> mPrerequisiteHandler;
72 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::OreUI::RouterEventing>> mEventing;
73 ::ll::TypedStorage<1, 1, bool> mIsNotifyingListeners;
74 ::ll::TypedStorage<8, 24, ::std::vector<::OreUI::Router::DeferredChangeNotification>> mDeferredChangeNotifications;
75 // NOLINTEND
76
77public:
78 // prevent constructor by default
79 Router();
80
81public:
82 // member functions
83 // NOLINTBEGIN
84 MCAPI Router(
85 ::std::unique_ptr<::OreUI::IRouteMatcher const> routeMatcher,
86 ::std::unique_ptr<::OreUI::IRoutePrerequisiteHandler> prerequisiteHandler,
87 ::std::unique_ptr<::OreUI::RouterEventing> routerEventing,
88 ::Bedrock::NotNullNonOwnerPtr<::ISceneStack> const& sceneStack
89 );
90
91 MCAPI ::std::vector<::OreUI::RouterLocation> _buildProjectedHistory() const;
92
93 MCAPI void _onChange(
94 ::std::optional<::OreUI::RouterLocation> const& oldLocation,
95 ::std::optional<::OreUI::RouterLocation> const& currentLocation
96 );
97
98 MCAPI bool _pushRoute(::std::string const& route, ::OreUI::Router::RouterPushMode mode);
99
100 MCAPI void _replaceCurrentRouteInHistory(
101 ::std::string const& newRoute,
102 ::OreUI::RouteHistoryAction action,
103 ::std::shared_ptr<::AbstractScene> const& scene
104 );
105
106 MCAPI ::std::optional<::OreUI::RouterLocation> getCurrentLocation() const;
107
108 MCAPI void goBack();
109
110 MCAPI bool isCurrentRoute(::std::string_view route) const;
111
112 MCAPI bool replaceRoute(::std::string const& route);
113
114 MCAPI void replaceRouteMatcher(::std::unique_ptr<::OreUI::IRouteMatcher> newRouteMatcher);
115
116 MCAPI ~Router();
117 // NOLINTEND
118
119public:
120 // static variables
121 // NOLINTBEGIN
122 MCAPI static ::std::add_lvalue_reference_t<char const[]> BEDROCK_PREFIX();
123 // NOLINTEND
124
125public:
126 // constructor thunks
127 // NOLINTBEGIN
128 MCAPI void* $ctor(
129 ::std::unique_ptr<::OreUI::IRouteMatcher const> routeMatcher,
130 ::std::unique_ptr<::OreUI::IRoutePrerequisiteHandler> prerequisiteHandler,
131 ::std::unique_ptr<::OreUI::RouterEventing> routerEventing,
132 ::Bedrock::NotNullNonOwnerPtr<::ISceneStack> const& sceneStack
133 );
134 // NOLINTEND
135
136public:
137 // destructor thunk
138 // NOLINTBEGIN
139 MCAPI void $dtor();
140 // NOLINTEND
141};
142
143} // namespace OreUI
Definition AbstractScene.h:5
Definition ISceneStack.h:5
Definition IRouteMatcher.h:7
Definition IRoutePrerequisiteHandler.h:7
Definition RouterEventing.h:7
Definition Router.h:7