Skip to content
LeviMC
English
AutoLightDark
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/util/IntRange.h"
8#include "mc/world/ContainerID.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
13class CompoundTag;
14class DataLoadHelper;
15class Interaction;
17class Player;
19struct Tick;
20struct TradeTable;
21namespace SharedTypes::v1_26_60 { struct EconomyTradeableComponentDefinition; }
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> mTradeTablePath;
36 ::ll::TypedStorage<1, 1, bool> mUseNewTradeScreen;
37 ::ll::TypedStorage<4, 4, int> mHeroDemandDiscount;
38 ::ll::TypedStorage<4, 8, ::IntRange> mCuredDiscount;
39 ::ll::TypedStorage<4, 8, ::IntRange> mMaxCuredDiscount;
40 ::ll::TypedStorage<4, 4, int> mNearbyCuredDiscount;
41 ::ll::TypedStorage<4, 4, int> mMaxNearbyCuredDiscount;
42 ::ll::TypedStorage<1, 1, bool> mPersistTrades;
43 ::ll::TypedStorage<1, 1, bool> mConvertTradesEconomy;
44 ::ll::TypedStorage<1, 1, bool> mShowTradeScreen;
45 ::ll::TypedStorage<1, 1, bool> mUseLegacyPrices;
46 ::ll::TypedStorage<8, 32, ::std::string> mGeneratedTablePath;
47 ::ll::TypedStorage<1, 1, bool> mConvertedFromVillagerV1;
48 ::ll::TypedStorage<4, 4, int> mDiscountDegradationTimeStamp;
49 // NOLINTEND
50
51public:
52 // prevent constructor by default
53 EconomyTradeableComponent& operator=(EconomyTradeableComponent const&);
54 EconomyTradeableComponent(EconomyTradeableComponent const&);
55 EconomyTradeableComponent();
56
57public:
58 // member functions
59 // NOLINTBEGIN
60 MCNAPI explicit EconomyTradeableComponent(::Actor& owner);
61
62 MCAPI bool _generateTrades();
63
64 MCNAPI ::TradeTable* _getTradeTable();
65
66 MCNAPI void addAdditionalSaveData(::CompoundTag& tag) const;
67
68 MCNAPI ::UpdateTradePacket createDataPacket(::ContainerID containerID);
69
71
72 MCNAPI ::IntRange getCurrentCuredDiscount() const;
73
74 MCNAPI ::Interaction getInteraction(::Player& player);
75
76 MCAPI ::MerchantRecipeList* getOffers();
77
78 MCNAPI uint getTradeExpForCurrentLevel() const;
79
80#ifdef LL_PLAT_C
81 MCNAPI ::std::vector<uint> getTradeExpRequirements() const;
82#endif
83
84 MCNAPI uint getTradeTier() const;
85
86 MCNAPI bool hasSupplyRemaining() const;
87
88 MCNAPI void initFromDefinition();
89
91
92 MCNAPI ::std::string const& loadDisplayName();
93
94 MCNAPI void matchExpAndTier();
95
96 MCNAPI void newServerAiStep();
97
98 MCAPI void notifyTrade(int recipeIndex, int numTrades);
99
100 MCNAPI void readAdditionalSaveData(::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
101
102 MCNAPI void reloadComponent();
103
104 MCAPI void resupplyTrades();
105
106#ifdef LL_PLAT_C
107 MCNAPI void setDataFromPacket(::UpdateTradePacket const& packet);
108#endif
109
110 MCNAPI void setNearbyCuredDiscount(int discount);
111
112 MCNAPI void setOffers(::MerchantRecipeList& offers);
113
114 MCNAPI void tickDiscountDegradationTimer(::Tick currentTick);
115
117
119
121
123 // NOLINTEND
124
125public:
126 // constructor thunks
127 // NOLINTBEGIN
128 MCNAPI void* $ctor(::Actor& owner);
129 // NOLINTEND
130
131public:
132 // destructor thunk
133 // NOLINTBEGIN
134 MCNAPI void $dtor();
135 // NOLINTEND
136};
Definition Actor.h:116
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
MCAPI void initFromDefinition()
MCAPI bool hasSupplyRemaining() const
MCAPI uint getTradeTier() const
MCAPI void initFromDefinition(::SharedTypes::v1_26_60::EconomyTradeableComponentDefinition const &definition)
MCAPI::IntRange getCurrentCuredDiscount() const
MCAPI void addAdditionalSaveData(::CompoundTag &tag) const
MCAPI void * $ctor(::Actor &owner)
MCAPI void tryIncrementNearbyCuredDiscount()
MCAPI void tryIncrementCuredDiscount()
MCAPI::TradeTable * _getTradeTable()
MCAPI void matchExpAndTier()
MCAPI::Interaction getInteraction(::Player &player)
MCAPI void setNearbyCuredDiscount(int discount)
MCAPI EconomyTradeableComponent(::Actor &owner)
MCAPI void reloadComponent()
MCAPI void fixVillagerTierToMatchTradeList(::MerchantRecipeList *oldOffers)
MCAPI void tryToTransferOldOffers(::MerchantRecipeList *oldOffers)
MCAPI void tickDiscountDegradationTimer(::Tick currentTick)
MCAPI void readAdditionalSaveData(::CompoundTag const &tag, ::DataLoadHelper &dataLoadHelper)
MCAPI uint getTradeExpForCurrentLevel() const
MCAPI void newServerAiStep()
MCAPI::UpdateTradePacket createDataPacket(::ContainerID containerID)
MCAPI void setOffers(::MerchantRecipeList &offers)
MCAPI::std::string const & loadDisplayName()
Definition Interaction.h:9
Definition MerchantRecipeList.h:13
Definition Player.h:131
Definition UpdateTradePacket.h:19
Definition EconomyTradeableComponentDefinition.h:15
Definition Tick.h:5
Definition TradeTable.h:13