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 BlockPos;
17class BlockSource;
18class BlockType;
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(::BlockType 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> assertBlockPresent(::BlockType const&, int, int, int, bool) = 0;
177
178 // vIndex: 35
179 virtual ::std::optional<::gametest::GameTestError>
180 assertBlockPresent(::BlockType const&, ::BlockPos const&, bool) = 0;
181
182 // vIndex: 37
183 virtual ::std::optional<::gametest::GameTestError>
184 assertBlockState(::BlockPos const&, ::std::function<bool(::Block const&)>) = 0;
185
186 // vIndex: 39
187 virtual ::std::optional<::gametest::GameTestError>
188 assertItemEntityPresent(::Item const&, int, int, int, float, bool) = 0;
189
190 // vIndex: 38
191 virtual ::std::optional<::gametest::GameTestError>
192 assertItemEntityPresent(::Item const&, ::BlockPos const&, float, bool) = 0;
193
194 // vIndex: 40
195 virtual ::std::optional<::gametest::GameTestError>
196 assertItemEntityCountIs(::Item const&, ::BlockPos const&, float, int) = 0;
197
198 // vIndex: 41
199 virtual ::std::optional<::gametest::GameTestError> assertContainerEmpty(::BlockPos const&) = 0;
200
201 // vIndex: 42
202 virtual ::std::optional<::gametest::GameTestError>
203 assertContainerContains(::ItemStack const&, ::BlockPos const&) = 0;
204
205 // vIndex: 43
206 virtual ::std::optional<::gametest::GameTestError>
207 assertEntityHasComponent(::ActorDefinitionIdentifier const&, ::std::string const&, ::BlockPos const&, bool) = 0;
208
209 // vIndex: 44
210 virtual ::std::optional<::gametest::GameTestError> assertEntityHasArmor(
212 ::SharedTypes::Legacy::ArmorSlot,
213 ::std::string const&,
214 int,
215 ::BlockPos const&,
216 bool
217 ) = 0;
218
219 // vIndex: 45
220 virtual ::std::optional<::gametest::GameTestError> print(::std::string const&) = 0;
221
222 // vIndex: 46
223 virtual ::std::optional<::gametest::GameTestError> assertRedstonePower(::BlockPos const&, int) = 0;
224
225 // vIndex: 47
226 virtual ::std::optional<::gametest::GameTestError> assertIsWaterlogged(::BlockPos const&, bool) = 0;
227
228 // vIndex: 48
229 virtual ::std::optional<::gametest::GameTestError> pulseRedstone(::BlockPos const&, int) = 0;
230
231 // vIndex: 49
232 virtual ::std::variant<::gametest::GameTestError, ::ScriptModuleGameTest::ScriptGameTestConnectivity>
233 getFenceConnectivity(::BlockPos const&) = 0;
234
235 // vIndex: 51
236 virtual ::std::variant<::gametest::GameTestError, ::BlockPos> worldPosition(::BlockPos const&) const = 0;
237
238 // vIndex: 50
239 virtual ::std::variant<::gametest::GameTestError, ::Vec3> worldPosition(::Vec3 const&) const = 0;
240
241 // vIndex: 53
242 virtual ::std::variant<::gametest::GameTestError, ::BlockPos> relativePosition(::BlockPos const&) const = 0;
243
244 // vIndex: 52
245 virtual ::std::variant<::gametest::GameTestError, ::Vec3> relativePosition(::Vec3 const&) const = 0;
246
247 // vIndex: 54
248 virtual ::std::optional<::gametest::GameTestError> setFluidContainer(::BlockPos const&, int) = 0;
249
250 // vIndex: 55
251 virtual ::std::optional<::gametest::GameTestError>
252 triggerInternalBlockEvent(::BlockPos const&, ::std::string const&, ::std::vector<float> const&) = 0;
253
254 // vIndex: 56
255 virtual ::std::optional<::gametest::GameTestError> assertCanReachLocation(::Mob&, ::BlockPos const&, bool) = 0;
256
257 // vIndex: 57
258 virtual ::std::optional<::gametest::GameTestError> spreadFromFaceTowardDirection(
259 ::BlockPos const&,
260 ::ScriptModuleMinecraft::ScriptFacing,
261 ::ScriptModuleMinecraft::ScriptFacing
262 ) = 0;
263
264 // vIndex: 58
265 virtual ::std::variant<::gametest::GameTestError, ::SimulatedPlayer*>
266 spawnSimulatedPlayer(::std::string const&, ::BlockPos const&, ::GameType) = 0;
267
268 // vIndex: 59
269 virtual void removeSimulatedPlayer(::SimulatedPlayer&) = 0;
270
271 // vIndex: 60
272 virtual ::std::variant<::gametest::GameTestError, ::Dimension*> getDimension() = 0;
273
274 // vIndex: 61
275 virtual ::std::optional<::gametest::GameTestError> getBlockSource(::BlockSource*&) = 0;
276
277 // vIndex: 62
278 virtual ::std::optional<::gametest::GameTestError> onPlayerJump(::Mob&, int) = 0;
279 // NOLINTEND
280
281public:
282 // member functions
283 // NOLINTBEGIN
284 MCNAPI ::Vec3 _absoluteVec(::Vec3 const& relativeVec) const;
285
286 MCNAPI void failIf(::std::function<::std::optional<::gametest::GameTestError>()> fn);
287
288 MCNAPI ::gametest::GameTestError generateErrorWithContext(
289 ::gametest::GameTestErrorType errorType,
290 ::std::string message,
291 ::BlockPos const& relativePos
292 ) const;
293
294 MCNAPI ::gametest::GameTestError generateErrorWithContext(
295 ::gametest::GameTestErrorType errorType,
296 ::std::string message,
297 ::std::vector<::std::string> params,
298 ::BlockPos const& relativePos
299 ) const;
300
301 MCNAPI ::std::variant<::gametest::GameTestError, uchar> rotateDirection(uchar direction) const;
302
303 MCNAPI void runAfterDelay(int ticksToDelay, ::std::function<::std::optional<::gametest::GameTestError>()> fn);
304
305 MCNAPI void runAtTickTime(int tickTime, ::std::function<::std::optional<::gametest::GameTestError>()> fn);
306
307 MCNAPI void succeedWhen(::std::function<::std::optional<::gametest::GameTestError>()> fn);
308
309 MCNAPI void until(
310 ::std::function<::std::optional<::gametest::GameTestError>()> testFn,
311 ::std::function<::std::optional<::gametest::GameTestError>()> doneFn
312 );
313 // NOLINTEND
314
315public:
316 // virtual function thunks
317 // NOLINTBEGIN
318
319 // NOLINTEND
320};
321
322} // namespace gametest
Definition Actor.h:102
Definition EnableNonOwnerReferences.h:7
Definition BlockPos.h:17
Definition BlockSource.h:66
Definition BlockType.h:84
Definition Block.h:37
Definition Dimension.h:83
Definition ItemStack.h:23
Definition Item.h:66
Definition Mob.h:47
Definition SimulatedPlayer.h:52
Definition Vec3.h:10
Definition BaseGameTestHelper.h:32
MCAPI void succeedWhen(::std::function<::std::optional<::gametest::GameTestError >()> fn)
MCAPI::Vec3 _absoluteVec(::Vec3 const &relativeVec) const
MCAPI void failIf(::std::function<::std::optional<::gametest::GameTestError >()> fn)
MCAPI void until(::std::function<::std::optional<::gametest::GameTestError >()> testFn, ::std::function<::std::optional<::gametest::GameTestError >()> doneFn)
MCAPI::gametest::GameTestError generateErrorWithContext(::gametest::GameTestErrorType errorType, ::std::string message, ::BlockPos const &relativePos) const
MCAPI void runAfterDelay(int ticksToDelay, ::std::function<::std::optional<::gametest::GameTestError >()> fn)
MCAPI void runAtTickTime(int tickTime, ::std::function<::std::optional<::gametest::GameTestError >()> fn)
MCAPI::gametest::GameTestError generateErrorWithContext(::gametest::GameTestErrorType errorType, ::std::string message, ::std::vector<::std::string > params, ::BlockPos const &relativePos) const
MCAPI ::std::variant<::gametest::GameTestError, uchar > rotateDirection(uchar direction) const
Definition ActorDefinitionIdentifier.h:15
Definition Alias.h:14