LeviLamina
Loading...
Searching...
No Matches
CommandOutput.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/server/commands/CommandOutputMessage.h"
5#include "mc/server/commands/CommandOutputParameter.h"
6#include "mc/server/commands/CommandPropertyBag.h"
7
8// auto generated inclusion list
9#include "mc/server/commands/CommandOutputMessageType.h"
10#include "mc/server/commands/CommandOutputType.h"
11
12// auto generated forward declare list
13// clang-format off
14class Actor;
18// clang-format on
19
20class CommandOutput {
21public:
22 // member variables
23 // NOLINTBEGIN
24 CommandOutputType mType;
25 std::unique_ptr<CommandPropertyBag> mBag;
26 std::vector<CommandOutputMessage> mMessages;
27 uint mSuccessCount;
28 bool mHasPlayerText;
29 // NOLINTEND
30
31 template <class First, class... Args>
32 requires(!std::is_same_v<std::remove_cvref_t<First>, std::vector<class CommandOutputParameter>>)
33 void success(fmt::format_string<First, Args...> fmt, First&& _args, Args&&... args) {
34 success(fmt::vformat(fmt.get(), fmt::make_format_args(_args, args...)));
35 }
36
37 template <class First, class... Args>
38 requires(!std::is_same_v<std::remove_cvref_t<First>, std::vector<class CommandOutputParameter>>)
39 void error(fmt::format_string<First, Args...> fmt, First&& _args, Args&&... args) {
40 error(fmt::vformat(fmt.get(), fmt::make_format_args(_args, args...)));
41 }
42
43public:
44 // member functions
45 // NOLINTBEGIN
46 MCAPI CommandOutput();
47
48 MCAPI CommandOutput(::CommandOutput const& rhs);
49
50 MCAPI explicit CommandOutput(::CommandOutputType type);
51
52 MCAPI void addMessage(
53 ::std::string_view msgId,
54 ::std::vector<::CommandOutputParameter> const& params,
55 ::CommandOutputMessageType type
56 );
57
58 MCAPI void addToResultList(::std::string const& key, ::std::string const& element);
59
60 MCAPI void addToResultList(::std::string const& key, ::Actor const& element);
61
62 MCAPI bool empty() const;
63
64 MCAPI void error(::std::string_view msgId, ::std::vector<::CommandOutputParameter> const& params = {});
65
66 MCAPI void forceOutput(::std::string_view msgId, ::std::vector<::CommandOutputParameter> const& params = {});
67
68 MCFOLD ::CommandPropertyBag const& getData() const;
69
70 MCFOLD ::std::vector<::CommandOutputMessage> const& getMessages() const;
71
72 MCFOLD uint getSuccessCount() const;
73
74 MCAPI bool hasErrorMessage() const;
75
76#ifdef LL_PLAT_S
77 MCFOLD bool hasPlayerText() const;
78#endif
79
80 MCAPI ::CommandOutput& operator=(::CommandOutput const& rhs);
81
82 MCAPI bool operator==(::CommandOutput const& other) const;
83
84 MCFOLD void setHasPlayerText();
85
86 MCAPI void success();
87
88 MCAPI void success(::std::string_view msgId, ::std::vector<::CommandOutputParameter> const& params = {});
89
90 MCAPI bool wantsData() const;
91 // NOLINTEND
92
93public:
94 // static functions
95 // NOLINTBEGIN
96 MCAPI static ::std::optional<::std::string> _mDataGetter(::CommandOutput const& payload);
97
98 MCAPI static void _mDataSetter(::CommandOutput& payload, ::std::optional<::std::string> jsonString);
99 // NOLINTEND
100
101public:
102 // constructor thunks
103 // NOLINTBEGIN
104 MCAPI void* $ctor();
105
106 MCAPI void* $ctor(::CommandOutput const& rhs);
107
108 MCAPI void* $ctor(::CommandOutputType type);
109 // NOLINTEND
110};
Definition Actor.h:125
Definition CommandOutputMessage.h:8
Definition CommandOutputParameter.h:15
Definition CommandPropertyBag.h:15