Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
s_inventory.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include "cpp_api/s_base.h"
8
9struct MoveAction;
10struct ItemStack;
11
13 : virtual public ScriptApiBase
14{
15public:
16 /* Detached inventory callbacks */
17 // Return number of accepted items to be moved
19 const MoveAction &ma, int count,
20 ServerActiveObject *player);
21 // Return number of accepted items to be put
23 const MoveAction &ma, const ItemStack &stack,
24 ServerActiveObject *player);
25 // Return number of accepted items to be taken
27 const MoveAction &ma, const ItemStack &stack,
28 ServerActiveObject *player);
29 // Report moved items
31 const MoveAction &ma, int count,
32 ServerActiveObject *player);
33 // Report put items
35 const MoveAction &ma, const ItemStack &stack,
36 ServerActiveObject *player);
37 // Report taken items
39 const MoveAction &ma, const ItemStack &stack,
40 ServerActiveObject *player);
41private:
43 const std::string &name, const char *callbackname);
44};
Definition s_base.h:64
Definition s_inventory.h:14
void detached_inventory_OnPut(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition s_inventory.cpp:123
int detached_inventory_AllowMove(const MoveAction &ma, int count, ServerActiveObject *player)
Definition s_inventory.cpp:13
bool getDetachedInventoryCallback(const std::string &name, const char *callbackname)
Definition s_inventory.cpp:174
void detached_inventory_OnMove(const MoveAction &ma, int count, ServerActiveObject *player)
Definition s_inventory.cpp:97
int detached_inventory_AllowTake(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition s_inventory.cpp:70
int detached_inventory_AllowPut(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition s_inventory.cpp:43
void detached_inventory_OnTake(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition s_inventory.cpp:147
Definition serveractiveobject.h:41
Definition inventory.h:19
Definition inventorymanager.h:128