LeviLamina
Loading...
Searching...
No Matches
BaseGameTestHelper.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
7#include "mc/deps/shared_types/legacy/actor/ArmorSlot.h"
8#include "mc/gametest/framework/GameTestErrorType.h"
9#include "mc/scripting/modules/minecraft/ScriptFacing.h"
10#include "mc/world/level/GameType.h"
11
12// auto generated forward declare list
13// clang-format off
14class Actor;
15class Block;
16class BlockLegacy;
17class BlockPos;
18class BlockSource;
19class Dimension;
20class Item;
21class ItemStack;
22class Mob;
23class SimulatedPlayer;
24class Vec3;
26namespace ScriptModuleGameTest { class ScriptGameTestConnectivity; }
27namespace gametest { struct GameTestError; }
28// clang-format on
29
30namespace gametest {
31
33public:
34 // member variables
35 // NOLINTBEGIN
41 // NOLINTEND
42
43public:
44 // prevent constructor by default
45 BaseGameTestHelper& operator=(BaseGameTestHelper const&);
48
49public:
50 // virtual functions
51 // NOLINTBEGIN
52 // vIndex: 0
53 virtual ~BaseGameTestHelper() /*override*/ = default;
54
55 // vIndex: 2
56 virtual void succeedWhenEntityPresent(::ActorDefinitionIdentifier const&, int, int, int, bool) = 0;
57
58 // vIndex: 1
59 virtual void succeedWhenEntityPresent(::ActorDefinitionIdentifier const&, ::BlockPos const&, bool) = 0;
60
61 // vIndex: 3
62 virtual void
63 succeedWhenEntityData(::BlockPos const&, ::ActorDefinitionIdentifier const&, ::std::function<bool(::Actor&)>) = 0;
64
65 // vIndex: 4
66 virtual void succeedWhenEntityHasComponent(
68 ::std::string const&,
69 ::BlockPos const&,
70 bool
71 ) = 0;
72
73 // vIndex: 7
74 virtual void succeedWhenBlockPresent(::Block const&, int, int, int, bool) = 0;
75
76 // vIndex: 6
77 virtual void succeedWhenBlockPresent(::Block const&, ::BlockPos const&, bool) = 0;
78
79 // vIndex: 5
80 virtual void succeedWhenBlockPresent(::BlockLegacy const&, ::BlockPos const&, bool) = 0;
81
82 // vIndex: 8
83 virtual void setNight() = 0;
84
85 // vIndex: 9
86 virtual void setDayTime(int) = 0;
87
88 // vIndex: 11
89 virtual ::std::optional<::gametest::GameTestError> setBlock(int, int, int, ::Block const&, int) = 0;
90
91 // vIndex: 10
92 virtual ::std::optional<::gametest::GameTestError> setBlock(::BlockPos const&, ::Block const&, int) = 0;
93
94 // vIndex: 12
95 virtual ::std::optional<::gametest::GameTestError> destroyBlock(::BlockPos const&, bool) = 0;
96
97 // vIndex: 14
98 virtual ::std::optional<::gametest::GameTestError> pressButton(int, int, int) = 0;
99
100 // vIndex: 13
101 virtual ::std::optional<::gametest::GameTestError> pressButton(::BlockPos const&) = 0;
102
103 // vIndex: 16
104 virtual ::std::optional<::gametest::GameTestError> pullLever(int, int, int) = 0;
105
106 // vIndex: 15
107 virtual ::std::optional<::gametest::GameTestError> pullLever(::BlockPos const&) = 0;
108
109 // vIndex: 17
110 virtual ::std::optional<::gametest::GameTestError> killAllEntities() = 0;
111
112 // vIndex: 20
113 virtual ::std::variant<::gametest::GameTestError, ::Actor*>
114 spawn(::ActorDefinitionIdentifier const&, int, int, int) = 0;
115
116 // vIndex: 19
117 virtual ::std::variant<::gametest::GameTestError, ::Actor*>
118 spawn(::ActorDefinitionIdentifier const&, ::BlockPos const&) = 0;
119
120 // vIndex: 18
121 virtual ::std::variant<::gametest::GameTestError, ::Actor*>
122 spawn(::ActorDefinitionIdentifier const&, ::Vec3 const&) = 0;
123
124 // vIndex: 21
125 virtual ::std::variant<::gametest::GameTestError, ::Actor*> spawnItem(::ItemStack const&, ::Vec3 const&) = 0;
126
127 // vIndex: 23
128 virtual ::std::variant<::gametest::GameTestError, ::Actor*>
129 spawnWithoutBehaviors(::ActorDefinitionIdentifier const&, ::BlockPos const&) = 0;
130
131 // vIndex: 22
132 virtual ::std::variant<::gametest::GameTestError, ::Actor*>
133 spawnWithoutBehaviors(::ActorDefinitionIdentifier const&, ::Vec3 const&) = 0;
134
135 // vIndex: 25
136 virtual ::std::optional<::gametest::GameTestError> walkTo(::Mob&, ::BlockPos const&, float) = 0;
137
138 // vIndex: 24
139 virtual ::std::optional<::gametest::GameTestError> walkTo(::Mob&, ::Vec3 const&, float) = 0;
140
141 // vIndex: 26
142 virtual ::std::optional<::gametest::GameTestError> setTntFuse(::Actor&, int) = 0;
143
144 // vIndex: 30
145 virtual ::std::optional<::gametest::GameTestError>
146 assertEntityPresent(::ActorDefinitionIdentifier const&, bool) = 0;
147
148 // vIndex: 29
149 virtual ::std::optional<::gametest::GameTestError>
150 assertEntityPresent(::ActorDefinitionIdentifier const&, int, int, int, bool) = 0;
151
152 // vIndex: 28
153 virtual ::std::optional<::gametest::GameTestError>
154 assertEntityPresent(::ActorDefinitionIdentifier const&, ::BlockPos const&, bool) = 0;
155
156 // vIndex: 27
157 virtual ::std::optional<::gametest::GameTestError>
158 assertEntityPresent(::ActorDefinitionIdentifier const&, ::BlockPos const&, float const, bool) = 0;
159
160 // vIndex: 32
161 virtual ::std::optional<::gametest::GameTestError>
162 assertEntityInstancePresent(::Actor const*, ::BlockPos const&, bool) = 0;
163
164 // vIndex: 31
165 virtual ::std::optional<::gametest::GameTestError> assertEntityInstancePresent(::Actor const*, bool) const = 0;
166
167 // vIndex: 33
168 virtual ::std::optional<::gametest::GameTestError>
169 assertEntityTouching(::ActorDefinitionIdentifier const&, ::Vec3 const&, bool) = 0;
170
171 // vIndex: 34
172 virtual ::std::optional<::gametest::GameTestError>
173 assertEntityState(::BlockPos const&, ::ActorDefinitionIdentifier const&, ::std::function<bool(::Actor&)>) = 0;
174
175 // vIndex: 36
176 virtual ::std::optional<::gametest::GameTestError>
177 assertBlockPresent(::BlockLegacy const&, int, int, int, bool) = 0;
178
179 // vIndex: 35
180 virtual ::std::optional<::gametest::GameTestError>
181 assertBlockPresent(::BlockLegacy const&, ::BlockPos const&, bool) = 0;
182
183 // vIndex: 37
184 virtual ::std::optional<::gametest::GameTestError>
185 assertBlockState(::BlockPos const&, ::std::function<bool(::Block const&)>) = 0;
186
187 // vIndex: 39
188 virtual ::std::optional<::gametest::GameTestError>
189 assertItemEntityPresent(::Item const&, int, int, int, float, bool) = 0;
190
191 // vIndex: 38
192 virtual ::std::optional<::gametest::GameTestError>
193 assertItemEntityPresent(::Item const&, ::BlockPos const&, float, bool) = 0;
194
195 // vIndex: 40
196 virtual ::std::optional<::gametest::GameTestError>
197 assertItemEntityCountIs(::Item const&, ::BlockPos const&, float, int) = 0;
198
199 // vIndex: 41
200 virtual ::std::optional<::gametest::GameTestError> assertContainerEmpty(::BlockPos const&) = 0;
201
202 // vIndex: 42
203 virtual ::std::optional<::gametest::GameTestError>
204 assertContainerContains(::ItemStack const&, ::BlockPos const&) = 0;
205
206 // vIndex: 43
207 virtual ::std::optional<::gametest::GameTestError>
208 assertEntityHasComponent(::ActorDefinitionIdentifier const&, ::std::string const&, ::BlockPos const&, bool) = 0;
209
210 // vIndex: 44
211 virtual ::std::optional<::gametest::GameTestError> assertEntityHasArmor(
213 ::SharedTypes::Legacy::ArmorSlot,
214 ::std::string const&,
215 int,
216 ::BlockPos const&,
217 bool
218 ) = 0;
219
220 // vIndex: 45
221 virtual ::std::optional<::gametest::GameTestError> print(::std::string const&) = 0;
222
223 // vIndex: 46
224 virtual ::std::optional<::gametest::GameTestError> assertRedstonePower(::BlockPos const&, int) = 0;
225
226 // vIndex: 47
227 virtual ::std::optional<::gametest::GameTestError> assertIsWaterlogged(::BlockPos const&, bool) = 0;
228
229 // vIndex: 48
230 virtual ::std::optional<::gametest::GameTestError> pulseRedstone(::BlockPos const&, int) = 0;
231
232 // vIndex: 49
233 virtual ::std::variant<::gametest::GameTestError, ::ScriptModuleGameTest::ScriptGameTestConnectivity>
234 getFenceConnectivity(::BlockPos const&) = 0;
235
236 // vIndex: 51
237 virtual ::std::variant<::gametest::GameTestError, ::BlockPos> worldPosition(::BlockPos const&) const = 0;
238
239 // vIndex: 50
240 virtual ::std::variant<::gametest::GameTestError, ::Vec3> worldPosition(::Vec3 const&) const = 0;
241
242 // vIndex: 53
243 virtual ::std::variant<::gametest::GameTestError, ::BlockPos> relativePosition(::BlockPos const&) const = 0;
244
245 // vIndex: 52
246 virtual ::std::variant<::gametest::GameTestError, ::Vec3> relativePosition(::Vec3 const&) const = 0;
247
248 // vIndex: 54
249 virtual ::std::optional<::gametest::GameTestError> setFluidContainer(::BlockPos const&, int) = 0;
250
251 // vIndex: 55
252 virtual ::std::optional<::gametest::GameTestError>
253 triggerInternalBlockEvent(::BlockPos const&, ::std::string const&, ::std::vector<float> const&) = 0;
254
255 // vIndex: 56
256 virtual ::std::optional<::gametest::GameTestError> assertCanReachLocation(::Mob&, ::BlockPos const&, bool) = 0;
257
258 // vIndex: 57
259 virtual ::std::optional<::gametest::GameTestError> spreadFromFaceTowardDirection(
260 ::BlockPos const&,
261 ::ScriptModuleMinecraft::ScriptFacing,
262 ::ScriptModuleMinecraft::ScriptFacing
263 ) = 0;
264
265 // vIndex: 58
266 virtual ::std::variant<::gametest::GameTestError, ::SimulatedPlayer*>
267 spawnSimulatedPlayer(::std::string const&, ::BlockPos const&, ::GameType) = 0;
268
269 // vIndex: 59
270 virtual void removeSimulatedPlayer(::SimulatedPlayer&) = 0;
271
272 // vIndex: 60
273 virtual ::std::variant<::gametest::GameTestError, ::Dimension*> getDimension() = 0;
274
275 // vIndex: 61
276 virtual ::std::optional<::gametest::GameTestError> getBlockSource(::BlockSource*&) = 0;
277
278 // vIndex: 62
279 virtual ::std::optional<::gametest::GameTestError> onPlayerJump(::Mob&, int) = 0;
280 // NOLINTEND
281
282public:
283 // member functions
284 // NOLINTBEGIN
285 MCAPI ::Vec3 _absoluteVec(::Vec3 const& relativeVec) const;
286
287 MCAPI ::std::optional<::gametest::GameTestError> assertCondition(bool condition, ::std::string const& message);
288
289 MCAPI void failIf(::std::function<::std::optional<::gametest::GameTestError>()> fn);
290
291 MCAPI ::gametest::GameTestError generateErrorWithContext(
292 ::gametest::GameTestErrorType message,
293 ::std::string relativePos,
294 ::BlockPos const& errorType
295 ) const;
296
297 MCAPI ::gametest::GameTestError generateErrorWithContext(
298 ::gametest::GameTestErrorType errorType,
299 ::std::string message,
300 ::std::vector<::std::string> params,
301 ::BlockPos const& relativePos
302 ) const;
303
304 MCAPI ::std::variant<::gametest::GameTestError, uchar> rotateDirection(uchar direction) const;
305
306 MCAPI void runAfterDelay(int ticksToDelay, ::std::function<::std::optional<::gametest::GameTestError>()> fn);
307
308 MCAPI void runAtTickTime(int tickTime, ::std::function<::std::optional<::gametest::GameTestError>()> fn);
309
310 MCAPI void succeedWhen(::std::function<::std::optional<::gametest::GameTestError>()> fn);
311
312 MCAPI void until(
313 ::std::function<::std::optional<::gametest::GameTestError>()> testFn,
314 ::std::function<::std::optional<::gametest::GameTestError>()> doneFn
315 );
316 // NOLINTEND
317
318public:
319 // destructor thunk
320 // NOLINTBEGIN
321
322 // NOLINTEND
323
324public:
325 // virtual function thunks
326 // NOLINTBEGIN
327
328 // NOLINTEND
329};
330
331} // namespace gametest
Definition Actor.h:104
Definition EnableNonOwnerReferences.h:7
Definition BlockLegacy.h:88
Definition BlockPos.h:18
Definition BlockSource.h:67
Definition Block.h:36
Definition Dimension.h:83
Definition ItemStack.h:25
Definition Item.h:65
Definition Mob.h:47
Definition SimulatedPlayer.h:47
Definition Vec3.h:10
Definition BaseGameTestHelper.h:32
Definition ActorDefinitionIdentifier.h:13
Definition Alias.h:14