LeviLamina
Loading...
Searching...
No Matches
WorldClock.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/container/EnumSet.h"
7#include "mc/deps/core/string/HashedString.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/deps/core/utility/UniqueOwnerPointer.h"
10#include "mc/deps/core/utility/pub_sub/Publisher.h"
11#include "mc/platform/brstd/flat_map.h"
12
13// auto generated forward declare list
14// clang-format off
15class PacketSender;
16class TimeMarker;
17struct TimeMarkerError;
18struct WorldClockData;
19namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
20namespace cereal { struct ReflectionCtx; }
21// clang-format on
22
23class WorldClock {
24public:
25 // WorldClock inner types define
26 enum class DirtyFlags : uchar {
27 SyncState = 0,
28 AddTimeMarker = 1,
29 RemoveTimeMarker = 2,
30 Count = 3,
31 };
32
33 using AddTimeMarkerResult = ::nonstd::expected<::Bedrock::NotNullNonOwnerPtr<::TimeMarker>, ::TimeMarkerError>;
34
35 using OnPauseSignature = void(::std::string const&);
36
37 using OnRestartSignature = void(::std::string const&, int&);
38
39 using OnResumeSignature = void(::std::string const&);
40
41 using OnTimeMarkerSignature = void(::std::string const&, ::Bedrock::NonOwnerPointer<::TimeMarker const> const);
42
43 using OnTimeModifiedSignature = void(::std::string const&, int);
44
45public:
46 // member variables
47 // NOLINTBEGIN
48 ::ll::TypedStorage<8, 48, ::HashedString> mName;
49 ::ll::TypedStorage<4, 4, int> mTime;
50 ::ll::TypedStorage<1, 1, bool> mIsPaused;
51 ::ll::TypedStorage<
52 8,
53 48,
55 uint64,
57 ::std::less<uint64>,
58 ::std::vector<uint64>,
59 ::std::vector<::Bedrock::UniqueOwnerPointer<::TimeMarker>>>>
60 mTimeMarkers;
61 ::ll::TypedStorage<8, 24, ::std::vector<uint64>> mTimeMarkersToAdd;
62 ::ll::TypedStorage<8, 24, ::std::vector<uint64>> mTimeMarkersToRemove;
63 ::ll::TypedStorage<1, 1, ::Bedrock::EnumSet<::WorldClock::DirtyFlags, 3>> mDirtyFlags;
64 ::ll::TypedStorage<
65 8,
66 128,
68 mOnPause;
69 ::ll::TypedStorage<
70 8,
71 128,
73 mOnResume;
74 ::ll::TypedStorage<
75 8,
76 128,
77 ::Bedrock::PubSub::
78 Publisher<void(::std::string const&, int&), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
79 mOnRestart;
80 ::ll::TypedStorage<
81 8,
82 128,
84 void(::std::string const&, ::Bedrock::NonOwnerPointer<::TimeMarker const>),
86 0>>
87 mOnTimeMarker;
88 ::ll::TypedStorage<
89 8,
90 128,
92 mOnTimeModified;
93 ::ll::TypedStorage<1, 1, bool> mTimeMarkerEventsRanThisTick;
94 // NOLINTEND
95
96public:
97 // member functions
98 // NOLINTBEGIN
99 MCAPI WorldClock();
100
101#ifdef LL_PLAT_C
102 MCAPI explicit WorldClock(::WorldClockData const& data);
103#endif
104
105 MCAPI WorldClock(::WorldClock const& rhs);
106
107 MCAPI void _sendAddTimeMarker(::PacketSender& packetSender) const;
108
109 MCAPI void _sendRemoveTimeMarker(::PacketSender& packetSender) const;
110
111 MCAPI void _sendSyncWorldClockState(::PacketSender& packetSender) const;
112
113 MCAPI void addTime(int time);
114
115 MCAPI ::nonstd::expected<::Bedrock::NotNullNonOwnerPtr<::TimeMarker>, ::TimeMarkerError>
116 addTimeMarker(::TimeMarker const& timeMarker, bool isVanilla);
117
118 MCAPI ::WorldClock& operator=(::WorldClock const& rhs);
119
120 MCAPI ::std::optional<::TimeMarkerError>
121 serverReloadCreatorTimeMarkers(::std::vector<::TimeMarker> const& timeMarkers);
122
123#ifdef LL_PLAT_C
124 MCAPI void tick();
125#endif
126
127 MCFOLD ::Bedrock::NonOwnerPointer<::TimeMarker const> const tryGetTimeMarker(uint64 timeMarkerId) const;
128
129 MCFOLD ::Bedrock::NonOwnerPointer<::TimeMarker> const tryGetTimeMarker(uint64 timeMarkerId);
130 // NOLINTEND
131
132public:
133 // static functions
134 // NOLINTBEGIN
135 MCAPI static void bindType(::cereal::ReflectionCtx& ctx);
136 // NOLINTEND
137
138public:
139 // constructor thunks
140 // NOLINTBEGIN
141 MCAPI void* $ctor();
142
143#ifdef LL_PLAT_C
144 MCAPI void* $ctor(::WorldClockData const& data);
145#endif
146
147 MCAPI void* $ctor(::WorldClock const& rhs);
148 // NOLINTEND
149};
Definition NonOwnerPointer.h:9
Definition Publisher.h:25
Definition UniqueOwnerPointer.h:11
Definition PacketSender.h:17
Definition TimeMarker.h:13
Definition flat_map.h:15
Definition TimeMarkerError.h:8
Definition WorldClockData.h:12
Definition ReflectionCtx.h:11
Definition ctx.h:5