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 Trade;
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 void _calculateDemandPrices(
52 int lowTierDiscount,
53 int highTierDiscount,
54 int nearbyCuredDiscount,
55 int heroEffectAmplifier,
56 bool hasHeroOfTheVillage,
57 ::BaseGameVersion baseGameVersion
58 );
59
60 MCAPI bool _generateTrades();
61
62 MCAPI ::TradeTable* _getTradeTable();
63
64 MCAPI uint _getTradeTierFromCurrentExp() const;
65
66 MCAPI void _rearrangeTradeList(::std::vector<::Trade>& tradeList, uint64 sampleCount);
67
68 MCAPI void _setMaxTradeTier(int tradeTier);
69
70 MCAPI void _setTradeTier(int tradeTier);
71
72 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
73
74 MCAPI ::UpdateTradePacket createDataPacket(::ContainerID containerID);
75
76 MCAPI void fixVillagerTierToMatchTradeList(::MerchantRecipeList* oldOffers);
77
78 MCAPI ::IntRange getCurrentCuredDiscount() const;
79
80 MCAPI int getCurrentNearbyCuredDiscount() const;
81
82 MCAPI ::InteractionResult getInteraction(::Player& player, ::ActorInteraction& interaction);
83
84 MCAPI ::MerchantRecipeList* getOffers();
85
86 MCAPI uint getTradeTier() const;
87
88 MCAPI void loadOffersFromTag(::CompoundTag const* tag);
89
90 MCAPI void matchExpAndTier();
91
92 MCAPI void newServerAiStep();
93
94 MCAPI void notifyTrade(int recipeIndex, int numTrades);
95
96 MCAPI void readAdditionalSaveData(::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
97
98 MCAPI void setCurrentTradeExp(int currentTradeExp);
99
100#ifdef LL_PLAT_C
101 MCAPI void setDataFromPacket(::UpdateTradePacket const& packet);
102#endif
103
104 MCAPI void setNearbyCuredDiscount(int discount);
105
106 MCAPI void tryIncrementCuredDiscount();
107
108 MCAPI void tryIncrementNearbyCuredDiscount();
109
110 MCAPI void tryToTransferOldOffers(::MerchantRecipeList* oldOffers);
111 // NOLINTEND
112};
Definition ActorInteraction.h:8
Definition Actor.h:106
Definition BaseGameVersion.h:8
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition InteractionResult.h:5
Definition MerchantRecipeList.h:13
Definition Player.h:129
Definition UpdateTradePacket.h:19
Definition ActorUniqueID.h:5
Definition IntRange.h:10
Definition TradeTable.h:13
Definition Trade.h:10