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