LeviLamina
Loading...
Searching...
No Matches
EconomyTradeableComponent.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 BaseGameVersion;
14class CompoundTag;
15class DataLoadHelper;
18class Player;
20struct ActorUniqueID;
21struct IntRange;
22struct Tick;
23struct TradeTable;
24// clang-format on
25
26class EconomyTradeableComponent {
27public:
28 // member variables
29 // NOLINTBEGIN
30 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mLastTradingPlayer;
31 ::ll::TypedStorage<4, 4, int> mUpdateMerchantTimer;
32 ::ll::TypedStorage<1, 1, bool> mAddRecipeOnUpdate;
33 ::ll::TypedStorage<4, 4, int> mRiches;
34 ::ll::TypedStorage<8, 8, ::Actor&> mOwner;
35 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MerchantRecipeList>> mOffers;
36 ::ll::TypedStorage<8, 32, ::std::string> mDisplayName;
37 ::ll::TypedStorage<8, 32, ::std::string> mGeneratedTablePath;
38 ::ll::TypedStorage<1, 1, bool> mConvertedFromVillagerV1;
39 ::ll::TypedStorage<4, 4, int> mDiscountDegradationTimeStamp;
40 // NOLINTEND
41
42public:
43 // prevent constructor by default
44 EconomyTradeableComponent& operator=(EconomyTradeableComponent const&);
45 EconomyTradeableComponent(EconomyTradeableComponent const&);
46 EconomyTradeableComponent();
47
48public:
49 // member functions
50 // NOLINTBEGIN
51 MCAPI explicit EconomyTradeableComponent(::Actor& owner);
52
53 MCAPI void _calculateDemandPrices(
54 int lowTierDiscount,
55 int highTierDiscount,
56 int nearbyCuredDiscount,
57 int heroEffectAmplifier,
58 bool hasHeroOfTheVillage,
59 ::BaseGameVersion baseGameVersion
60 );
61
62 MCAPI bool _generateTrades();
63
64 MCAPI ::TradeTable* _getTradeTable();
65
66 MCAPI void _setMaxTradeTier(int tradeTier);
67
68 MCAPI void _setTradeTier(int tradeTier);
69
70 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
71
72 MCAPI bool canLevelUp() const;
73
74 MCAPI ::UpdateTradePacket createDataPacket(::ContainerID containerID);
75
76 MCAPI void fixVillagerTierToMatchTradeList(::MerchantRecipeList* oldOffers);
77
78 MCAPI ::IntRange getCurrentCuredDiscount() const;
79
80 MCFOLD ::std::string const& getDisplayName() const;
81
82 MCAPI ::InteractionResult getInteraction(::Player& player, ::ActorInteraction& interaction);
83
84 MCAPI ::MerchantRecipeList* getOffers();
85
86 MCFOLD int getRiches() const;
87
88 MCAPI uint getTradeExpForCurrentLevel() const;
89
90#ifdef LL_PLAT_C
91 MCAPI ::std::vector<uint> getTradeExpRequirements() const;
92#endif
93
94 MCAPI uint getTradeTier() const;
95
96#ifdef LL_PLAT_C
97 MCAPI void handleHaggleAudioCue(bool canPlayValidHaggleSound);
98#endif
99
100 MCAPI bool hasSupplyRemaining() const;
101
102 MCFOLD void initFromDefinition();
103
104 MCAPI ::std::string const& loadDisplayName();
105
106 MCAPI void loadOffersFromTag(::CompoundTag const* tag);
107
108 MCAPI void matchExpAndTier();
109
110 MCAPI void newServerAiStep();
111
112 MCAPI void notifyTrade(int recipeIndex, int numTrades);
113
114 MCAPI void readAdditionalSaveData(::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
115
116 MCAPI void reloadComponent();
117
118 MCAPI void resupplyTrades();
119
120 MCAPI void setCurrentTradeExp(int currentTradeExp);
121
122#ifdef LL_PLAT_C
123 MCAPI void setDataFromPacket(::UpdateTradePacket const& packet);
124#endif
125
126 MCAPI void setNearbyCuredDiscount(int discount);
127
128 MCAPI void setOffers(::MerchantRecipeList& offers);
129
130 MCFOLD void setRiches(int riches);
131
132 MCAPI bool shouldConvertTrades() const;
133
134 MCAPI bool shouldPersistTrades() const;
135
136 MCAPI bool showTradeScreen();
137
138 MCAPI void tickDiscountDegradationTimer(::Tick currentTick);
139
140 MCAPI void tryIncrementCuredDiscount();
141
142 MCAPI void tryIncrementNearbyCuredDiscount();
143
144 MCAPI void tryToTransferOldOffers(::MerchantRecipeList* oldOffers);
145
146 MCAPI ~EconomyTradeableComponent();
147 // NOLINTEND
148
149public:
150 // static functions
151 // NOLINTBEGIN
152 MCAPI static bool isUseNewTradeScreen(::Actor const& owner);
153 // NOLINTEND
154
155public:
156 // constructor thunks
157 // NOLINTBEGIN
158 MCAPI void* $ctor(::Actor& owner);
159 // NOLINTEND
160
161public:
162 // destructor thunk
163 // NOLINTBEGIN
164 MCAPI void $dtor();
165 // NOLINTEND
166};
Definition ActorInteraction.h:8
Definition Actor.h:125
Definition BaseGameVersion.h:13
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition InteractionResult.h:5
Definition MerchantRecipeList.h:17
Definition Player.h:137
Definition UpdateTradePacket.h:19
Definition ActorUniqueID.h:10
Definition IntRange.h:11
Definition Tick.h:5
Definition TradeTable.h:15