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
13// clang-format on
14
15class Objective : public ::Bedrock::EnableNonOwnerReferences {
16public:
17 // member variables
18 // NOLINTBEGIN
19 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ScoreboardId, int>> mScores;
20 ::ll::TypedStorage<8, 32, ::std::string const> mName;
21 ::ll::TypedStorage<8, 32, ::std::string> mDisplayName;
22 ::ll::TypedStorage<8, 8, ::ObjectiveCriteria const&> mCriteria;
23 // NOLINTEND
24
25public:
26 [[nodiscard]] ScoreInfo getPlayerScore(::ScoreboardId const& id) const {
27 auto it = mScores->find(id);
28 if (it == mScores->end()) {
29 return ScoreInfo{nullptr, false, 0};
30 }
31 return ScoreInfo{this, true, it->second};
32 }
33
34public:
35 // prevent constructor by default
36 Objective& operator=(Objective const&);
37 Objective(Objective const&);
38 Objective();
39
40public:
41 // member functions
42 // NOLINTBEGIN
43 MCAPI Objective(::std::string const& name, ::ObjectiveCriteria const& criteria);
44
45#ifdef LL_PLAT_C
46 MCAPI ::std::vector<::ScoreboardId> getPlayers() const;
47#endif
48 // NOLINTEND
49
50public:
51 // constructor thunks
52 // NOLINTBEGIN
53 MCAPI void* $ctor(::std::string const& name, ::ObjectiveCriteria const& criteria);
54 // NOLINTEND
55};
Definition EnableNonOwnerReferences.h:7
Definition ObjectiveCriteria.h:8
Definition ScoreInfo.h:10
Definition ScoreboardId.h:11