Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
npc.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/server/commands/CurrentCmdVersion.h"
7
8// auto generated forward declare list
9// clang-format off
10class Actor;
11class NpcComponent;
13class Player;
14namespace Json { class Value; }
15namespace npc { struct ActionContainer; }
16namespace npc { struct CommandAction; }
17namespace npc { struct UrlAction; }
18// clang-format on
19
20namespace npc {
21// functions
22// NOLINTBEGIN
23MCNAPI void
24fillCommands(::npc::CommandAction& cmd, ::std::vector<::std::string_view> const& src, ::CurrentCmdVersion ver);
25
26MCNAPI ::std::optional<::std::variant<::npc::CommandAction, ::npc::UrlAction>> fromJson(::Json::Value const& root);
27
28#ifdef LL_PLAT_C
29MCNAPI ::std::string_view getRawButtonLabel(::std::variant<::npc::CommandAction, ::npc::UrlAction> const& action);
30#endif
31
32MCNAPI void
33handlePacket(::Actor& owner, ::Player& initiator, ::NpcComponent& npcComp, ::NpcRequestPacket const& request);
34
35#ifdef LL_PLAT_C
36MCNAPI void setActionValue(::std::variant<::npc::CommandAction, ::npc::UrlAction>& action, ::std::string_view value);
37
38MCNAPI void setButtonLabel(::std::variant<::npc::CommandAction, ::npc::UrlAction>& action, ::std::string_view value);
39#endif
40
41MCNAPI ::Json::Value toJson(::npc::CommandAction const& action);
42
43MCNAPI ::Json::Value toJson(::npc::ActionContainer const& container);
44
45MCNAPI ::Json::Value toJson(::npc::UrlAction const& urlAction);
46// NOLINTEND
47
48} // namespace npc
Definition Actor.h:116
Definition Value.h:16
Definition NpcComponent.h:24
Definition NpcRequestPacket.h:19
Definition Player.h:131
Definition ActionContainer.h:11
Definition CommandAction.h:17
Definition UrlAction.h:11