LeviLamina
Loading...
Searching...
No Matches
InventoryTransaction.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/platform/Result.h"
7#include "mc/util/BidirectionalUnorderedMap.h"
8#include "mc/world/inventory/transaction/InventorySource.h"
9#include "mc/world/inventory/transaction/InventoryTransactionError.h"
10
11// auto generated forward declare list
12// clang-format off
13class BinaryStream;
14class BlockPalette;
15class InventoryAction;
17class ItemStack;
18class Player;
20// clang-format on
21
23public:
24 // member variables
25 // NOLINTBEGIN
26 ::ll::TypedStorage<8, 64, ::std::unordered_map<::InventorySource, ::std::vector<::InventoryAction>>> mActions;
27 ::ll::TypedStorage<8, 24, ::std::vector<::InventoryTransactionItemGroup>> mContents;
28 // NOLINTEND
29
30public:
31 // member functions
32 // NOLINTBEGIN
33 MCFOLD void _logTransaction(bool isClientSide) const;
34
35 MCAPI void addAction(::InventoryAction const& action);
36
37 MCAPI void addItemToContent(::ItemStack const& item, int count);
38
39 MCAPI ::InventoryTransactionError executeFull(::Player& p, bool isSenderAuthority) const;
40
41 MCAPI void forceBalanceTransaction();
42
43 MCAPI ::std::vector<::InventoryAction> const& getActions(::InventorySource const& source) const;
44
45 MCAPI void markValidActionsForSerialization(bool isClientSide) const;
46
47 MCAPI void postLoadItems(::BlockPalette& blockPalette, bool isClientSide);
48
49 MCAPI void recalculateBalance();
50
51 MCAPI ::InventoryTransactionError verifyFull(::Player& p, bool isSenderAuthority) const;
52
53 MCAPI void write(::BinaryStream& stream) const;
54
56 // NOLINTEND
57
58public:
59 // static functions
60 // NOLINTBEGIN
61 MCAPI static bool checkTransactionItemsMatch(::ItemStack const& serverItem, ::ItemStack const& clientItem);
62
63 MCAPI static ::Bedrock::Result<::InventoryTransaction> deserialize(::ReadOnlyBinaryStream& stream);
64
65 MCAPI static ::std::string const getInventoryTransactionErrorName(::InventoryTransactionError type);
66 // NOLINTEND
67
68public:
69 // static variables
70 // NOLINTBEGIN
71 MCAPI static ::BidirectionalUnorderedMap<::InventoryTransactionError, ::std::string> const&
72 inventoryTransactionErrorMap();
73 // NOLINTEND
74
75public:
76 // destructor thunk
77 // NOLINTBEGIN
78 MCAPI void $dtor();
79 // NOLINTEND
80};
Definition BinaryStream.h:11
Definition BlockPalette.h:21
Definition InventoryAction.h:15
Definition InventorySource.h:9
Definition InventoryTransactionItemGroup.h:11
Definition InventoryTransaction.h:22
Definition ItemStack.h:35
Definition Player.h:137
Definition ReadOnlyBinaryStream.h:8