LeviLamina
Loading...
Searching...
No Matches
Abilities.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/server/commands/PlayerPermissionLevel.h"
7#include "mc/world/actor/player/AbilitiesIndex.h"
8#include "mc/world/actor/player/Ability.h"
9
10// auto generated forward declare list
11// clang-format off
12class CompoundTag;
13// clang-format on
14
15class Abilities {
16public:
17 // member variables
18 // NOLINTBEGIN
19 ::ll::TypedStorage<4, 240, ::std::array<::Ability, 20>> mAbilities;
20 // NOLINTEND
21
22public:
23 // prevent constructor by default
24 Abilities& operator=(Abilities const&);
25 Abilities();
26
27public:
28 // member functions
29 // NOLINTBEGIN
30 MCAPI Abilities(::Abilities const& rhs);
31
32 MCAPI explicit Abilities(bool setToDefaults);
33
34 MCAPI void addSaveData(::CompoundTag& parentTag) const;
35
36 MCFOLD void forEachAbility(
37 ::std::function<void(::Ability&, ::AbilitiesIndex)> const& callback,
38 ::Ability::Options requiredOptions
39 );
40
41 MCAPI void forEachAbility(
42 ::std::function<void(::Ability const&, char const*)> const& callback,
43 ::Ability::Options requiredOptions
44 ) const;
45
46 MCFOLD void forEachAbility(
47 ::std::function<void(::Ability const&, ::AbilitiesIndex)> const& callback,
48 ::Ability::Options requiredOptions
49 ) const;
50
51 MCAPI bool loadSaveData(::CompoundTag const& parentTag);
52
53 MCAPI void setFromPermissions(::PlayerPermissionLevel permissions);
54 // NOLINTEND
55
56public:
57 // static functions
58 // NOLINTBEGIN
59 MCAPI static ::std::array<::Ability const, 20> _initDefaultAbilities();
60
61#ifdef LL_PLAT_C
62 MCAPI static ::std::optional<::std::string> getDiff(::Abilities const& lhs, ::Abilities const& rhs);
63#endif
64
65 MCAPI static ::AbilitiesIndex nameToAbilityIndex(::std::string const& name);
66 // NOLINTEND
67
68public:
69 // static variables
70 // NOLINTBEGIN
71 MCAPI static ::std::array<char const*, 20>& ABILITY_NAMES();
72
73#ifdef LL_PLAT_C
74 MCAPI static ::std::string const& DIFF_ABILITIY_AT();
75#endif
76
77 MCAPI static ::Ability& INVALID_ABILITY();
78
79 MCAPI static ::std::string const& SERIALIZATION_TAG();
80 // NOLINTEND
81
82public:
83 // constructor thunks
84 // NOLINTBEGIN
85 MCAPI void* $ctor(::Abilities const& rhs);
86
87 MCAPI void* $ctor(bool setToDefaults);
88 // NOLINTEND
89};
Definition Ability.h:5
Definition CompoundTag.h:18