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 // prevent constructor by default
45 CommandOutput() = default;
46
47public:
48 // member functions
49 // NOLINTBEGIN
50 MCAPI CommandOutput(::CommandOutput const& rhs);
51
52 MCAPI explicit CommandOutput(::CommandOutputType type);
53
54 MCAPI void addMessage(
55 ::std::string_view msgId,
56 ::std::vector<::CommandOutputParameter> const& params,
57 ::CommandOutputMessageType type
58 );
59
60 MCAPI void addToResultList(::std::string const& key, ::Actor const& element);
61
62 MCAPI void error(::std::string_view msgId, ::std::vector<::CommandOutputParameter> const& params = {});
63
64 MCAPI ::CommandOutput& operator=(::CommandOutput const& rhs);
65
66 MCAPI void success(::std::string_view msgId, ::std::vector<::CommandOutputParameter> const& params = {});
67
68 MCAPI ~CommandOutput();
69 // NOLINTEND
70
71public:
72 // static functions
73 // NOLINTBEGIN
74 MCAPI static ::std::optional<::std::string> _mDataGetter(::CommandOutput const& payload);
75
76 MCAPI static void _mDataSetter(::CommandOutput& payload, ::std::optional<::std::string> jsonString);
77 // NOLINTEND
78
79public:
80 // constructor thunks
81 // NOLINTBEGIN
82 MCAPI void* $ctor(::CommandOutput const& rhs);
83
84 MCAPI void* $ctor(::CommandOutputType type);
85 // NOLINTEND
86
87public:
88 // destructor thunk
89 // NOLINTBEGIN
90 MCAPI void $dtor();
91 // NOLINTEND
92};
Definition Actor.h:106
Definition CommandOutputMessage.h:8
Definition CommandOutputParameter.h:15
Definition CommandPropertyBag.h:8