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
7// auto generated inclusion list
8#include "mc/server/commands/CommandOutputMessageType.h"
9#include "mc/server/commands/CommandOutputType.h"
10
11// auto generated forward declare list
12// clang-format off
13class Actor;
17// clang-format on
18
19class CommandOutput {
20public:
21 // member variables
22 // NOLINTBEGIN
23 CommandOutputType mType;
24 std::unique_ptr<CommandPropertyBag> mBag;
25 std::vector<CommandOutputMessage> mMessages;
26 uint mSuccessCount;
27 bool mHasPlayerText;
28 // NOLINTEND
29
30 template <class First, class... Args>
31 requires(!std::is_same_v<std::remove_cvref_t<First>, std::vector<class CommandOutputParameter>>)
32 void success(fmt::format_string<First, Args...> fmt, First&& _args, Args&&... args) {
33 success(fmt::vformat(fmt.get(), fmt::make_format_args(_args, args...)));
34 }
35
36 template <class First, class... Args>
37 requires(!std::is_same_v<std::remove_cvref_t<First>, std::vector<class CommandOutputParameter>>)
38 void error(fmt::format_string<First, Args...> fmt, First&& _args, Args&&... args) {
39 error(fmt::vformat(fmt.get(), fmt::make_format_args(_args, args...)));
40 }
41
42public:
43 // prevent constructor by default
44 CommandOutput();
45
46public:
47 // member functions
48 // NOLINTBEGIN
49 MCAPI CommandOutput(::CommandOutput const& rhs);
50
51 MCAPI explicit CommandOutput(::CommandOutputType type);
52
53 MCAPI void addMessage(
54 ::std::string_view msgId,
55 ::std::vector<::CommandOutputParameter> const& params,
56 ::CommandOutputMessageType type
57 );
58
59 MCAPI void addToResultList(::std::string const& key, ::Actor const& element);
60
61 MCAPI void error(::std::string_view msgId, ::std::vector<::CommandOutputParameter> const& params = {});
62
63 MCAPI ::CommandOutput& operator=(::CommandOutput const& rhs);
64
65 MCAPI void success(::std::string_view msgId, ::std::vector<::CommandOutputParameter> const& params = {});
66
67 MCAPI ~CommandOutput();
68 // NOLINTEND
69
70public:
71 // static functions
72 // NOLINTBEGIN
73 MCAPI static ::std::optional<::std::string> _mDataGetter(::CommandOutput const& payload);
74
75 MCAPI static void _mDataSetter(::CommandOutput& payload, ::std::optional<::std::string> jsonString);
76 // NOLINTEND
77
78public:
79 // constructor thunks
80 // NOLINTBEGIN
81 MCAPI void* $ctor(::CommandOutput const& rhs);
82
83 MCAPI void* $ctor(::CommandOutputType type);
84 // NOLINTEND
85
86public:
87 // destructor thunk
88 // NOLINTBEGIN
89 MCAPI void $dtor();
90 // NOLINTEND
91};
Definition Actor.h:106
Definition CommandOutputMessage.h:8
Definition CommandOutputParameter.h:15
Definition CommandPropertyBag.h:8