LeviLamina
Loading...
Searching...
No Matches
LegacyTradeableComponent.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 TradeTable;
20// clang-format on
21
22class LegacyTradeableComponent {
23public:
24 // member variables
25 // NOLINTBEGIN
26 ::ll::TypedStorage<1, 1, bool> mAddRecipeOnUpdate;
27 ::ll::TypedStorage<1, 1, bool> mResetLockedOnFirstTrade;
28 ::ll::TypedStorage<1, 1, bool> mWillingToBreed;
29 ::ll::TypedStorage<4, 4, int> mRiches;
30 ::ll::TypedStorage<4, 4, int> mTradeTier;
31 ::ll::TypedStorage<4, 4, int> mUpdateMerchantTimer;
32 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mLastPlayerTradeID;
33 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MerchantRecipeList>> mOffers;
34 ::ll::TypedStorage<8, 32, ::std::string> mDisplayName;
35 ::ll::TypedStorage<8, 24, ::std::vector<int>> mTradeRecipeFirstTime;
36 // NOLINTEND
37
38public:
39 // prevent constructor by default
40 LegacyTradeableComponent& operator=(LegacyTradeableComponent const&);
41 LegacyTradeableComponent(LegacyTradeableComponent const&);
42 LegacyTradeableComponent();
43
44public:
45 // member functions
46 // NOLINTBEGIN
47 MCAPI ::TradeTable* _getTradeTable(::Actor& owner);
48
49 MCAPI bool _refreshTrades(::Actor& owner);
50
51 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
52
53 MCAPI ::UpdateTradePacket createDataPacket(::Actor& owner, ::ContainerID containerID);
54
55 MCAPI ::InteractionResult getInteraction(::Actor& owner, ::Player& player, ::ActorInteraction& interaction);
56
57 MCAPI ::std::string const& loadDisplayName(::Actor& owner);
58
59 MCAPI void notifyTrade(::Actor& owner, int recipeIndex, int numTrades);
60
61 MCAPI ::LegacyTradeableComponent& operator=(::LegacyTradeableComponent&&);
62
63 MCAPI void readAdditionalSaveData(::Actor& owner, ::CompoundTag const& tag, ::DataLoadHelper&);
64
65 MCAPI void reloadComponent(::Actor& actor);
66
67 MCAPI void restockAllRecipes(::Actor& owner);
68
69#ifdef LL_PLAT_C
70 MCAPI void setDataFromPacket(::UpdateTradePacket const& packet);
71#endif
72
73 MCAPI void setOffers(::MerchantRecipeList& offers);
74
75 MCAPI bool shouldConvertTrades(::Actor& owner) const;
76
77 MCAPI bool shouldPersistTrades(::Actor& owner) const;
78
79 MCAPI void updateTradeTier(::Actor& owner);
80
81 MCAPI ~LegacyTradeableComponent();
82 // NOLINTEND
83
84public:
85 // static functions
86 // NOLINTBEGIN
87 MCAPI static bool isUseNewTradeScreen(::Actor const& owner);
88 // NOLINTEND
89
90public:
91 // destructor thunk
92 // NOLINTBEGIN
93 MCAPI void $dtor();
94 // NOLINTEND
95};
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:129
Definition UpdateTradePacket.h:19
Definition TradeTable.h:13