LeviLamina
Loading...
Searching...
No Matches
Objective.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/world/scores/ScoreInfo.h"
5
6// auto generated inclusion list
7#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
8#include "mc/world/scores/ScoreboardId.h"
9
10// auto generated forward declare list
11// clang-format off
12class CompoundTag;
14class Scoreboard;
15// clang-format on
16
17class Objective : public ::Bedrock::EnableNonOwnerReferences {
18public:
19 // member variables
20 // NOLINTBEGIN
21 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ScoreboardId, int>> mScores;
22 ::ll::TypedStorage<8, 32, ::std::string const> mName;
23 ::ll::TypedStorage<8, 32, ::std::string> mDisplayName;
24 ::ll::TypedStorage<8, 8, ::ObjectiveCriteria const&> mCriteria;
25 // NOLINTEND
26
27public:
28 [[nodiscard]] ScoreInfo getPlayerScore(::ScoreboardId const& id) const {
29 auto it = mScores->find(id);
30 if (it == mScores->end()) {
31 return ScoreInfo{nullptr, false, 0};
32 }
33 return ScoreInfo{this, true, it->second};
34 }
35
36public:
37 // prevent constructor by default
38 Objective& operator=(Objective const&);
39 Objective(Objective const&);
40 Objective();
41
42public:
43 // member functions
44 // NOLINTBEGIN
45 MCAPI Objective(::std::string const& name, ::ObjectiveCriteria const& criteria);
46
47#ifdef LL_PLAT_C
48 MCAPI ::std::vector<::ScoreboardId> getPlayers() const;
49#endif
50 // NOLINTEND
51
52public:
53 // static functions
54 // NOLINTBEGIN
55#ifdef LL_PLAT_S
56 MCAPI static ::std::unique_ptr<::Objective> deserialize(::CompoundTag const& dataTag, ::Scoreboard& owner);
57
58 MCAPI static ::std::unique_ptr<::CompoundTag> serialize(::Objective const& toSave);
59#endif
60 // NOLINTEND
61
62public:
63 // constructor thunks
64 // NOLINTBEGIN
65 MCAPI void* $ctor(::std::string const& name, ::ObjectiveCriteria const& criteria);
66 // NOLINTEND
67};
Definition EnableNonOwnerReferences.h:7
Definition CompoundTag.h:18
Definition ObjectiveCriteria.h:13
Definition Scoreboard.h:33
Definition ScoreInfo.h:10
Definition ScoreboardId.h:11
Definition serialize.h:11