LeviLamina
Loading...
Searching...
No Matches
LegacyTradeableComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/legacy/ActorUniqueID.h"
7#include "mc/world/ContainerID.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
13class CompoundTag;
14class DataLoadHelper;
17class Player;
19struct TradeTable;
20// clang-format on
21
22class LegacyTradeableComponent {
23public:
24 // member variables
25 // NOLINTBEGIN
26 ::ll::TypedStorage<1, 1, bool> mAddRecipeOnUpdate;
27 ::ll::TypedStorage<1, 1, bool> mResetLockedOnFirstTrade;
28 ::ll::TypedStorage<1, 1, bool> mWillingToBreed;
29 ::ll::TypedStorage<4, 4, int> mRiches;
30 ::ll::TypedStorage<4, 4, int> mTradeTier;
31 ::ll::TypedStorage<4, 4, int> mUpdateMerchantTimer;
32 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mLastPlayerTradeID;
33 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MerchantRecipeList>> mOffers;
34 ::ll::TypedStorage<8, 32, ::std::string> mDisplayName;
35 ::ll::TypedStorage<8, 24, ::std::vector<int>> mTradeRecipeFirstTime;
36 // NOLINTEND
37
38public:
39 // prevent constructor by default
40 LegacyTradeableComponent& operator=(LegacyTradeableComponent const&);
41 LegacyTradeableComponent(LegacyTradeableComponent const&);
42
43public:
44 // member functions
45 // NOLINTBEGIN
46 MCFOLD void DecrementMerchantTimer();
47
48 MCFOLD void IncrementTradeTier();
49
50 MCAPI LegacyTradeableComponent();
51
52 MCAPI ::TradeTable* _getTradeTable(::Actor& owner);
53
54 MCAPI bool _refreshTrades(::Actor& owner);
55
56 MCAPI void _updateMaxTradeTier(::Actor& owner, int tradeTier);
57
58 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
59
60 MCAPI ::UpdateTradePacket createDataPacket(::Actor& owner, ::ContainerID containerID);
61
62 MCFOLD bool getAddRecipeOnUpdate() const;
63
64 MCFOLD ::std::string const& getDisplayName() const;
65
66 MCAPI ::InteractionResult getInteraction(::Actor& owner, ::Player& player, ::ActorInteraction& interaction);
67
68 MCFOLD ::ActorUniqueID const getLastPlayerTradeID() const;
69
70 MCAPI ::MerchantRecipeList* getOffers(::Actor& owner);
71
72 MCFOLD bool getResetLockedOnFirstTrade() const;
73
74 MCFOLD int getRiches() const;
75
76 MCFOLD int getTradeTier() const;
77
78 MCFOLD int getUpdateMerchantTimer() const;
79
80#ifdef LL_PLAT_C
81 MCAPI void handleHaggleAudioCue(::Actor& owner, bool canPlayValidHaggleSound);
82
83 MCAPI void initFromDefinition(::Actor& actor);
84#endif
85
86 MCAPI ::std::string const& loadDisplayName(::Actor& owner);
87
88 MCAPI void loadOffersFromTag(::CompoundTag const* tag);
89
90 MCAPI void notifyTrade(::Actor& owner, int recipeIndex, int numTrades);
91
92 MCAPI ::LegacyTradeableComponent& operator=(::LegacyTradeableComponent&&);
93
94 MCAPI void readAdditionalSaveData(::Actor& owner, ::CompoundTag const& tag, ::DataLoadHelper&);
95
96 MCAPI void reloadComponent(::Actor& actor);
97
98 MCAPI void restockAllRecipes(::Actor& owner);
99
100 MCFOLD void setAddRecipeOnUpdate(bool addRecipeOnUpdate);
101
102#ifdef LL_PLAT_C
103 MCAPI void setDataFromPacket(::UpdateTradePacket const& packet);
104#endif
105
106 MCAPI void setOffers(::MerchantRecipeList& offers);
107
108 MCFOLD void setResetLockedOnFirstTrade(bool resetLockedOnFirstTrade);
109
110 MCFOLD void setRiches(int riches);
111
112 MCFOLD void setTradeTier(int tier);
113
114 MCAPI bool shouldConvertTrades(::Actor& owner) const;
115
116 MCAPI bool shouldPersistTrades(::Actor& owner) const;
117
118 MCAPI void updateTradeTier(::Actor& owner);
119
120 MCAPI ~LegacyTradeableComponent();
121 // NOLINTEND
122
123public:
124 // static functions
125 // NOLINTBEGIN
126 MCAPI static bool isUseNewTradeScreen(::Actor const& owner);
127 // NOLINTEND
128
129public:
130 // constructor thunks
131 // NOLINTBEGIN
132 MCAPI void* $ctor();
133 // NOLINTEND
134
135public:
136 // destructor thunk
137 // NOLINTBEGIN
138 MCAPI void $dtor();
139 // NOLINTEND
140};
Definition ActorInteraction.h:8
Definition Actor.h:123
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition InteractionResult.h:5
Definition MerchantRecipeList.h:17
Definition Player.h:136
Definition UpdateTradePacket.h:19
Definition TradeTable.h:15