Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
BlockChangedOperation.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/script_core/runtime/scripting/Result_deprecated.h"
7#include "mc/editor/Generator.h"
8#include "mc/editor/IOperation.h"
9
10// auto generated forward declare list
11// clang-format off
12class BlockPos;
13class BlockSource;
14class CompoundTag;
15class Level;
16namespace Editor { class ServiceProviderCollection; }
17namespace Editor { struct CoroutineStatus; }
18namespace Editor::Transactions { struct BlockChangeIntentData; }
19namespace Editor::Transactions { struct BlockChangedOperationData; }
20// clang-format on
21
22namespace Editor::Transactions {
23
24class BlockChangedOperation : public ::Editor::Transactions::IOperation {
25public:
26 // BlockChangedOperation inner types declare
27 // clang-format off
28 struct ActiveProcessData;
29 // clang-format on
30
31 // BlockChangedOperation inner types define
32 enum class NeighborUpdateTransition : int {
33 NewToPrevious = 0,
34 PreviousToNew = 1,
35 Unchanged = 2,
36 };
37
38 enum class ReplayPhase : int {
39 Neutralize = 0,
40 Apply = 1,
41 Completed = 2,
42 };
43
44 enum class ReplayStrategy : int {
45 Default = 0,
46 NeutralizeLiquids = 1,
47 };
48
49 struct ActiveProcessData {
50 public:
51 // member variables
52 // NOLINTBEGIN
67 // NOLINTEND
68
69 public:
70 // prevent constructor by default
71 ActiveProcessData& operator=(ActiveProcessData const&);
72 ActiveProcessData(ActiveProcessData const&);
73 ActiveProcessData();
74 };
75
76public:
77 // member variables
78 // NOLINTBEGIN
84 // NOLINTEND
85
86public:
87 // prevent constructor by default
88 BlockChangedOperation& operator=(BlockChangedOperation const&);
89 BlockChangedOperation(BlockChangedOperation const&);
90 BlockChangedOperation();
91
92public:
93 // virtual functions
94 // NOLINTBEGIN
95 virtual ~BlockChangedOperation() /*override*/ = default;
96
97 virtual ::std::string_view getName() /*override*/;
98
99 virtual ::Editor::Transactions::IOperation::ProcessResult
100 _processUndo(::Editor::ServiceProviderCollection& services) /*override*/;
101
102 virtual ::Editor::Transactions::IOperation::ProcessResult
103 _processRedo(::Editor::ServiceProviderCollection& services) /*override*/;
104
105 virtual ::Editor::Transactions::IOperation::ProcessingState _getProcessingState() const /*override*/;
106
107 virtual ::Scripting::Result_deprecated<void> _clearActiveProcess() /*override*/;
108 // NOLINTEND
109
110public:
111 // member functions
112 // NOLINTBEGIN
113 MCNAPI void _neutralizeLiquids(::BlockSource& region, uint64 startIndex, uint64 count) const;
114
115 MCNAPI ::Scripting::Result_deprecated<void>
116 _performOperation(::Editor::ServiceProviderCollection& services, bool isUndo);
117
118 MCNAPI ::Scripting::Result_deprecated<void> _setBlock(
119 ::Level& level,
120 ::BlockSource& region,
121 uint const& blockToPlace,
122 uint const& extraBlockToPlace,
123 ::CompoundTag* blockData,
124 ::BlockPos const& pos
125 ) const;
126
127 MCNAPI ::Scripting::Result_deprecated<void>
128 _setBlocks(::Level& level, ::BlockSource& region, bool isUndo, uint64 startIndex, uint64 count) const;
129
130 MCNAPI void _updateNeighbors(
131 ::Level& level,
132 ::BlockSource& region,
133 ::Editor::Transactions::BlockChangedOperation::NeighborUpdateTransition transition,
134 uint64 startIndex,
135 uint64 count
136 ) const;
137 // NOLINTEND
138
139public:
140 // static functions
141 // NOLINTBEGIN
142 MCNAPI static void appendResolvedBlockChange(
143 ::BlockSource const& region,
144 ::Editor::Transactions::BlockChangeIntentData& blockIntentData,
145 ::std::vector<::Editor::Transactions::BlockChangedOperationData>& changedBlocks
146 );
147
148 MCNAPI static ::std::vector<::Editor::Transactions::BlockChangeIntentData>
149 createBlockChangeIntentFromLocation(::BlockSource const& region, ::BlockPos const& pos, bool includeAll);
150 // NOLINTEND
151
152public:
153 // static variables
154 // NOLINTBEGIN
155 MCNAPI static ::std::string const& DEFAULT_OPERATION_NAME();
156
157 MCNAPI static ::std::string const& LIQUID_SAFE_OPERATION_NAME();
158 // NOLINTEND
159
160public:
161 // virtual function thunks
162 // NOLINTBEGIN
163 MCNAPI ::std::string_view $getName();
164
165 MCNAPI ::Editor::Transactions::IOperation::ProcessResult
167
168 MCNAPI ::Editor::Transactions::IOperation::ProcessResult
170
171 MCNAPI ::Editor::Transactions::IOperation::ProcessingState $_getProcessingState() const;
172
173 MCNAPI ::Scripting::Result_deprecated<void> $_clearActiveProcess();
174
175
176 // NOLINTEND
177
178public:
179 // vftables
180 // NOLINTBEGIN
181 MCNAPI static void** $vftable();
182 // NOLINTEND
183};
184
185} // namespace Editor::Transactions
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition CompoundTag.h:18
Definition ServiceProviderCollection.h:7
static MCAPI ::std::string const & LIQUID_SAFE_OPERATION_NAME()
MCAPI ::Scripting::Result_deprecated< void > _setBlocks(::Level &level, ::BlockSource &region, bool isUndo, uint64 startIndex, uint64 count) const
MCAPI::Editor::Transactions::IOperation::ProcessingState $_getProcessingState() const
MCAPI ::Scripting::Result_deprecated< void > _performOperation(::Editor::ServiceProviderCollection &services, bool isUndo)
static MCAPI ::std::string const & DEFAULT_OPERATION_NAME()
static MCAPI ::std::vector<::Editor::Transactions::BlockChangeIntentData > createBlockChangeIntentFromLocation(::BlockSource const &region, ::BlockPos const &pos, bool includeAll)
MCAPI void _neutralizeLiquids(::BlockSource &region, uint64 startIndex, uint64 count) const
MCAPI::Editor::Transactions::IOperation::ProcessResult $_processRedo(::Editor::ServiceProviderCollection &services)
static MCAPI void appendResolvedBlockChange(::BlockSource const &region, ::Editor::Transactions::BlockChangeIntentData &blockIntentData, ::std::vector<::Editor::Transactions::BlockChangedOperationData > &changedBlocks)
MCAPI void _updateNeighbors(::Level &level, ::BlockSource &region, ::Editor::Transactions::BlockChangedOperation::NeighborUpdateTransition transition, uint64 startIndex, uint64 count) const
MCAPI ::Scripting::Result_deprecated< void > $_clearActiveProcess()
MCAPI::Editor::Transactions::IOperation::ProcessResult $_processUndo(::Editor::ServiceProviderCollection &services)
MCAPI ::Scripting::Result_deprecated< void > _setBlock(::Level &level, ::BlockSource &region, uint const &blockToPlace, uint const &extraBlockToPlace, ::CompoundTag *blockData, ::BlockPos const &pos) const
Definition IOperation.h:15
Definition Level.h:255
STL namespace.
Definition CoroutineStatus.h:7
Definition BlockChangeIntentData.h:13
Definition BlockChangedOperationData.h:7
Definition Alias.h:14