LeviLamina
Loading...
Searching...
No Matches
ActorHistory.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/ecs/gamerefs_entity/EntityContext.h"
7#include "mc/deps/game_refs/OwnerPtr.h"
8
9// auto generated forward declare list
10// clang-format off
11class EntityRegistry;
14// clang-format on
15
16class ActorHistory {
17public:
18 // ActorHistory inner types declare
19 // clang-format off
20 struct Snapshot;
21 // clang-format on
22
23 // ActorHistory inner types define
24 struct Snapshot {
25 public:
26 // member variables
27 // NOLINTBEGIN
28 ::ll::TypedStorage<8, 32, ::OwnerPtr<::EntityContext>> mSnapshotState;
29 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::IMovementCorrection>>> mCorrections;
30 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IReplayableActorInput>> mCapturedInput;
31 ::ll::TypedStorage<1, 1, bool> mIsCorrection;
32 // NOLINTEND
33
34 public:
35 // member functions
36 // NOLINTBEGIN
37#ifdef LL_PLAT_C
38 MCAPI ~Snapshot();
39#endif
40 // NOLINTEND
41
42 public:
43 // destructor thunk
44 // NOLINTBEGIN
45#ifdef LL_PLAT_C
46 MCFOLD void $dtor();
47#endif
48 // NOLINTEND
49 };
50
51public:
52 // member variables
53 // NOLINTBEGIN
54 ::ll::TypedStorage<8, 8, uint64 const> mHistoryWindow;
55 ::ll::TypedStorage<8, 40, ::std::deque<::ActorHistory::Snapshot>> mSnapshots;
56 ::ll::TypedStorage<8, 8, uint64> mOldestFrame;
57 ::ll::TypedStorage<4, 4, ::std::bitset<2>> mPendingCorrections;
58 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::IMovementCorrection>>> mQueuedCorrection;
59 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IReplayableActorInput>> mNextInput;
60 // NOLINTEND
61
62public:
63 // prevent constructor by default
64 ActorHistory();
65
66public:
67 // member functions
68 // NOLINTBEGIN
69 MCAPI explicit ActorHistory(uint64 historyWindow);
70
71 MCAPI void addCorrectionToFrame(::std::shared_ptr<::IMovementCorrection> correction, uint64 frame);
72
73#ifdef LL_PLAT_C
74 MCAPI void addFrame(::EntityContext& entity, uint64 frame, ::EntityRegistry& registry);
75#endif
76
77 MCAPI void clearFrames();
78
79#ifdef LL_PLAT_C
80 MCFOLD ::ActorHistory::Snapshot const* getFrame(uint64 frame) const;
81#endif
82
83 MCFOLD ::ActorHistory::Snapshot* getFrame(uint64 frame);
84
85#ifdef LL_PLAT_C
86 MCFOLD uint64 getHistoryWindow() const;
87#endif
88
89 MCFOLD uint64 getOldestFrame() const;
90
91 MCAPI ::IReplayableActorInput* getOrCreateNextFrame();
92
93 MCAPI void queueCorrection(::std::shared_ptr<::IMovementCorrection> correction);
94
95 MCAPI void setSnapshotAsCorrection(uint64 frame);
96
97 MCAPI ~ActorHistory();
98 // NOLINTEND
99
100public:
101 // static functions
102 // NOLINTBEGIN
103#ifdef LL_PLAT_C
104 MCAPI static ::ActorHistory::Snapshot createSnapshot(
105 ::EntityContext const& entity,
106 ::EntityRegistry& registry,
107 ::std::unique_ptr<::IReplayableActorInput> input
108 );
109
110 MCAPI static void prepareEntityForRewindFromCapture(
111 ::EntityContext const& fromCapture,
112 ::EntityContext const& fromLive,
113 ::EntityContext& toRewind
114 );
115
116 MCAPI static void updateHistoryEntity(::EntityContext const& fromRewind, ::EntityContext& toHistory);
117#endif
118 // NOLINTEND
119
120public:
121 // constructor thunks
122 // NOLINTBEGIN
123 MCAPI void* $ctor(uint64 historyWindow);
124 // NOLINTEND
125
126public:
127 // destructor thunk
128 // NOLINTBEGIN
129 MCAPI void $dtor();
130 // NOLINTEND
131};
Definition EntityContext.h:17
Definition EntityRegistry.h:11
Definition ActorHistory.h:24
Definition IMovementCorrection.h:15
Definition IReplayableActorInput.h:29