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