LeviLamina
Loading...
Searching...
No Matches
BaseGameTestInstance.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/util/Rotation.h"
7
8// auto generated forward declare list
9// clang-format off
10class AABB;
11class BlockPos;
12class BoundingBox;
13class Vec3;
14class WeakEntityRef;
15struct DimensionType;
16namespace gametest { class BaseGameTestFunction; }
17namespace gametest { class GameTestSequence; }
18namespace gametest { class IGameTestHelperProvider; }
19namespace gametest { class IGameTestListener; }
20namespace gametest { struct GameTestError; }
21// clang-format on
22
23namespace gametest {
24
25class BaseGameTestInstance {
26public:
27 // member variables
28 // NOLINTBEGIN
59 // NOLINTEND
60
61public:
62 // prevent constructor by default
63 BaseGameTestInstance& operator=(BaseGameTestInstance const&);
64 BaseGameTestInstance(BaseGameTestInstance const&);
65 BaseGameTestInstance();
66
67public:
68 // virtual functions
69 // NOLINTBEGIN
70 virtual ~BaseGameTestInstance();
71
72 virtual void initialize();
73
74 virtual bool hasStructureBlock() const = 0;
75
76 virtual void clearStructure() = 0;
77
78 virtual void spawnStructure();
79
80 virtual ::std::optional<::AABB> getStructureBounds() const = 0;
81
82 virtual ::std::optional<::Vec3> getStructureBlockPivot() const = 0;
83
84 virtual ::std::optional<::Vec3> getStructureBlockPosPivot() const = 0;
85
86 virtual ::BoundingBox getStructureBoundingBox() const = 0;
87
88 virtual ::DimensionType getStructureDimension() const = 0;
89
90 virtual int _getLevelTick() const = 0;
91
92 virtual bool _isTestReady() = 0;
93
94 virtual void _rerun();
95
96 virtual void _removeSimulatedPlayers();
97 // NOLINTEND
98
99public:
100 // member functions
101 // NOLINTBEGIN
103 ::gametest::BaseGameTestFunction const& testFunction,
104 ::std::unique_ptr<::gametest::IGameTestHelperProvider> helper
105 );
106
107 MCNAPI void addListener(::std::shared_ptr<::gametest::IGameTestListener> listener);
108
109 MCNAPI void addSimulatedPlayer(::WeakEntityRef simulatedPlayer);
110
111 MCNAPI ::gametest::GameTestSequence& createSequence();
112
113 MCNAPI void fail(::gametest::GameTestError error, bool canRetry);
114
115 MCNAPI void finish(bool canRetry);
116
117 MCNAPI int getAttempts() const;
118
119 MCNAPI ::std::optional<::gametest::GameTestError> const& getError() const;
120
121 MCNAPI int getMaxAttempts() const;
122
123 MCNAPI int getRequiredSuccesses() const;
124
125#ifdef LL_PLAT_S
126 MCNAPI ::Rotation getRotation() const;
127#endif
128
129 MCNAPI ::BlockPos getStructureBlockPos() const;
130
131 MCNAPI int getSuccesses() const;
132
133 MCNAPI ::std::string const& getTestName() const;
134
135 MCNAPI int getTick() const;
136
137#ifdef LL_PLAT_S
138 MCNAPI bool hasRetryAttempts() const;
139#endif
140
141 MCNAPI bool isFlaky() const;
142
143 MCNAPI bool isRequired() const;
144
145 MCNAPI void removeListener(::std::shared_ptr<::gametest::IGameTestListener> listener);
146
147 MCNAPI void runCallbacksOnFinish();
148
149 MCNAPI void setMaxRunCount(int repeatCount);
150
151 MCNAPI void setRotation(::Rotation rotation);
152
153 MCNAPI void setRunAtTickTime(int tickTime, ::std::function<::std::optional<::gametest::GameTestError>()> fn);
154
155 MCNAPI void setRunOnFinish(::std::function<::std::optional<::gametest::GameTestError>()> fn);
156
157 MCNAPI void setStopOnFailure(bool stopOnFailure);
158
159 MCNAPI void setStructureBlockPos(::BlockPos const& structureBlockPos);
160
161 MCNAPI void startExecution();
162
163 MCNAPI void startTest();
164
165 MCNAPI void succeed();
166
167 MCNAPI void tick();
168 // NOLINTEND
169
170public:
171 // constructor thunks
172 // NOLINTBEGIN
173 MCNAPI void* $ctor(
174 ::gametest::BaseGameTestFunction const& testFunction,
175 ::std::unique_ptr<::gametest::IGameTestHelperProvider> helper
176 );
177 // NOLINTEND
178
179public:
180 // destructor thunk
181 // NOLINTBEGIN
182 MCNAPI void $dtor();
183 // NOLINTEND
184
185public:
186 // virtual function thunks
187 // NOLINTBEGIN
188 MCNAPI void $initialize();
189
190 MCNAPI void $spawnStructure();
191
192 MCNAPI void $_rerun();
193
195
196
197 // NOLINTEND
198
199public:
200 // vftables
201 // NOLINTBEGIN
202 MCNAPI static void** $vftable();
203 // NOLINTEND
204};
205
206} // namespace gametest
Definition AABB.h:18
Definition BlockPos.h:21
Definition BoundingBox.h:13
Definition Vec3.h:10
Definition WeakEntityRef.h:14
Definition BaseGameTestFunction.h:16
MCAPI void removeListener(::std::shared_ptr<::gametest::IGameTestListener > listener)
MCAPI int getSuccesses() const
MCAPI void setStructureBlockPos(::BlockPos const &structureBlockPos)
MCAPI bool isFlaky() const
MCAPI void setStopOnFailure(bool stopOnFailure)
MCAPI::BlockPos getStructureBlockPos() const
MCAPI bool isRequired() const
MCAPI void addSimulatedPlayer(::WeakEntityRef simulatedPlayer)
MCAPI void addListener(::std::shared_ptr<::gametest::IGameTestListener > listener)
MCAPI void finish(bool canRetry)
MCAPI int getMaxAttempts() const
MCAPI void fail(::gametest::GameTestError error, bool canRetry)
MCAPI::gametest::GameTestSequence & createSequence()
MCAPI void * $ctor(::gametest::BaseGameTestFunction const &testFunction, ::std::unique_ptr<::gametest::IGameTestHelperProvider > helper)
MCAPI void setRunOnFinish(::std::function<::std::optional<::gametest::GameTestError >()> fn)
MCAPI::std::string const & getTestName() const
MCAPI int getRequiredSuccesses() const
MCAPI void setRotation(::Rotation rotation)
MCAPI int getAttempts() const
MCAPI ::std::optional<::gametest::GameTestError > const & getError() const
MCAPI void setMaxRunCount(int repeatCount)
static MCAPI void ** $vftable()
MCAPI void setRunAtTickTime(int tickTime, ::std::function<::std::optional<::gametest::GameTestError >()> fn)
MCAPI BaseGameTestInstance(::gametest::BaseGameTestFunction const &testFunction, ::std::unique_ptr<::gametest::IGameTestHelperProvider > helper)
Definition GameTestSequence.h:12
Definition IGameTestHelperProvider.h:13
Definition IGameTestListener.h:12
Definition DimensionType.h:5
Definition GameTestError.h:17
Definition Alias.h:14