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;
12class CompoundTag;
13class DataLoadHelper;
14class Interaction;
16class Player;
18struct IntRange;
19struct Tick;
20struct TradeTable;
21// clang-format on
22
23class EconomyTradeableComponent {
24public:
25 // member variables
26 // NOLINTBEGIN
27 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mLastTradingPlayer;
28 ::ll::TypedStorage<4, 4, int> mUpdateMerchantTimer;
29 ::ll::TypedStorage<1, 1, bool> mAddRecipeOnUpdate;
30 ::ll::TypedStorage<4, 4, int> mRiches;
31 ::ll::TypedStorage<8, 8, ::Actor&> mOwner;
32 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MerchantRecipeList>> mOffers;
33 ::ll::TypedStorage<8, 32, ::std::string> mDisplayName;
34 ::ll::TypedStorage<8, 32, ::std::string> mGeneratedTablePath;
35 ::ll::TypedStorage<1, 1, bool> mConvertedFromVillagerV1;
36 ::ll::TypedStorage<4, 4, int> mDiscountDegradationTimeStamp;
37 // NOLINTEND
38
39public:
40 // prevent constructor by default
41 EconomyTradeableComponent& operator=(EconomyTradeableComponent const&);
42 EconomyTradeableComponent(EconomyTradeableComponent const&);
43 EconomyTradeableComponent();
44
45public:
46 // member functions
47 // NOLINTBEGIN
48 MCAPI explicit EconomyTradeableComponent(::Actor& owner);
49
50 MCAPI bool _generateTrades();
51
52 MCAPI ::TradeTable* _getTradeTable();
53
54 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
55
56 MCAPI ::UpdateTradePacket createDataPacket(::ContainerID containerID);
57
58 MCAPI void fixVillagerTierToMatchTradeList(::MerchantRecipeList* oldOffers);
59
60 MCAPI ::IntRange getCurrentCuredDiscount() const;
61
62 MCAPI ::Interaction getInteraction(::Player& player);
63
64 MCAPI ::MerchantRecipeList* getOffers();
65
66 MCAPI uint getTradeExpForCurrentLevel() const;
67
68#ifdef LL_PLAT_C
69 MCAPI ::std::vector<uint> getTradeExpRequirements() const;
70#endif
71
72 MCAPI uint getTradeTier() const;
73
74 MCAPI bool hasSupplyRemaining() const;
75
76 MCAPI ::std::string const& loadDisplayName();
77
78 MCAPI void matchExpAndTier();
79
80 MCAPI void newServerAiStep();
81
82 MCAPI void notifyTrade(int recipeIndex, int numTrades);
83
84 MCAPI void readAdditionalSaveData(::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
85
86 MCAPI void reloadComponent();
87
88 MCAPI void resupplyTrades();
89
90#ifdef LL_PLAT_C
91 MCAPI void setDataFromPacket(::UpdateTradePacket const& packet);
92#endif
93
94 MCAPI void setNearbyCuredDiscount(int discount);
95
96 MCAPI void setOffers(::MerchantRecipeList& offers);
97
98 MCAPI void tickDiscountDegradationTimer(::Tick currentTick);
99
100 MCAPI void tryIncrementCuredDiscount();
101
102 MCAPI void tryIncrementNearbyCuredDiscount();
103
104 MCAPI void tryToTransferOldOffers(::MerchantRecipeList* oldOffers);
105 // NOLINTEND
106
107public:
108 // constructor thunks
109 // NOLINTBEGIN
110 MCAPI void* $ctor(::Actor& owner);
111 // NOLINTEND
112};
Definition Actor.h:113
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
Definition Interaction.h:9
Definition MerchantRecipeList.h:13
Definition Player.h:129
Definition UpdateTradePacket.h:19
Definition IntRange.h:10
Definition Tick.h:5
Definition TradeTable.h:13