ofs | hex dump | ascii |
---|
0000 | 42 42 33 44 5a b3 00 00 01 00 00 00 54 45 58 53 25 00 00 00 72 61 69 6c 2e 70 6e 67 00 01 00 00 | BB3DZ.......TEXS%...rail.png.... |
0020 | 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 80 3f 00 00 80 3f 00 00 00 00 42 52 55 53 2e 00 00 | ................?...?....BRUS... |
0040 | 00 01 00 00 00 42 72 75 73 68 2e 30 30 31 00 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 | .....Brush.001....?...?...?...?. |
0060 | 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 4e 4f 44 45 eb b2 00 00 74 72 61 63 6b 5f 73 77 72 | ...............NODE....track_swr |
0080 | 63 72 5f 36 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 3f 00 00 80 3f 00 00 80 3f 00 00 | cr_60................?...?...?.. |
00a0 | 80 3f 00 00 00 00 00 00 00 00 00 00 00 00 4d 45 53 48 ac b2 00 00 ff ff ff ff 56 52 54 53 0c 98 | .?............MESH........VRTS.. |
00c0 | 00 00 01 00 00 00 01 00 00 00 02 00 00 00 b5 34 40 bf 1f 85 eb be c0 79 80 3e be 21 df 3d 0d 89 | ...............4@......y.>.!.=.. |
00e0 | 06 be f8 3d 7c 3f 0d 41 34 3f f6 b3 30 3f 0e 37 2f bf 1f 85 eb be 45 70 f2 3d b5 ad 5a 3f 0d 89 | ...=|?.A4?..0?.7/.....Ep.=..Z?.. |
0100 | 06 be 02 c7 00 bf 0f 41 34 3f 20 c0 07 3f 57 96 97 bf 1f 85 eb be fc 10 07 be be 21 df bd 0d 89 | .......A4?...?W............!.... |
0120 | 06 be f8 3d 7c bf c0 fb 2e 3e 1c c0 07 3f 2a 15 a0 bf 1f 85 eb be aa 65 2a 3a b5 ad 5a bf 0d 89 | ...=|....>...?*........e*:..Z... |
0140 | 06 be 02 c7 00 3f bc fb 2e 3e f4 b3 30 3f 6a 4b 36 bf ae 47 e1 be 2e c6 31 3e e9 93 74 3f 2d 9d | .....?...>..0?jK6..G....1>..t?-. |
0160 | 96 3e ab 81 d5 3c 0e 41 34 3f bc be ea 3e 6a 4b 36 bf 15 ae c7 be 2e c6 31 3e e6 39 73 3f 35 61 | .>...<.A4?...>jK6.......1>.9s?5a |
0180 | 9a be 46 d1 a2 3d 0f 41 34 3f 36 9e c8 3e 84 20 9b bf 15 ae c7 be d0 05 9d bd 44 03 22 bf 35 61 | ..F..=.A4?6..>............D.".5a |
01a0 | 9a be 6d 8d 36 bf ce fb 2e 3e 26 9e c8 3e 84 20 9b bf ae 47 e1 be d0 05 9d bd 30 dd 17 bf 2d 99 | ..m.6....>&..>.....G......0...-. |
01c0 | 96 3e 80 d5 3f bf c8 fb 2e 3e b0 be ea 3e b5 34 40 bf 1f 85 eb be c0 79 80 3e be 21 df 3d 0d 89 | .>..?....>...>.4@......y.>.!.=.. |
01e0 | 06 be f8 3d 7c 3f 16 41 34 3f c0 6e d0 3c 2a 15 a0 bf 1f 85 eb be aa 65 2a 3a b5 ad 5a bf 0d 89 | ...=|?.A4?.n.<*........e*:..Z... |
0200 | 06 be 02 c7 00 3f de fb 2e 3e 00 6e d0 3c fe 8a 9c bf ae 47 e1 be d9 8e 5f bd e9 93 74 bf 2d 99 | .....?...>.n.<.....G...._...t.-. |
0220 | 96 3e ab 81 d5 bc ca fb 2e 3e a0 21 c7 3d 5d 20 39 bf ae 47 e1 be 68 65 48 3e 30 dd 17 3f 2d 99 | .>.......>.!.=].9..G..heH>0..?-. |
0240 | 96 3e 80 d5 3f 3f 12 41 34 3f e0 21 c7 3d 2a 15 a0 bf 1f 85 eb be aa 65 2a 3a b5 ad 5a bf 0d 89 | .>..??.A4?.!.=*........e*:/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef L_INVENTORY_H_
#define L_INVENTORY_H_
#include "lua_api/l_base.h"
#include "inventory.h"
#include "inventorymanager.h"
class Player;
/*
InvRef
*/
class InvRef : public ModApiBase {
private:
InventoryLocation m_loc;
static const char className[];
static const luaL_reg methods[];
static InvRef *checkobject(lua_State *L, int narg);
static Inventory* getinv(lua_State *L, InvRef *ref);
static InventoryList* getlist(lua_State *L, InvRef *ref,
const char *listname);
static void reportInventoryChange(lua_State *L, InvRef *ref);
// Exported functions
// garbage collector
static int gc_object(lua_State *L);
// is_empty(self, listname) -> true/false
static int l_is_empty(lua_State *L);
// get_size(self, listname)
static int l_get_size(lua_State *L);
// get_width(self, listname)
static int l_get_width(lua_State *L);
// set_size(self, listname, size)
static int l_set_size(lua_State *L);
// set_width(self, listname, size)
static int l_set_width(lua_State *L);
// get_stack(self, listname, i) -> itemstack
static int l_get_stack(lua_State *L);
// set_stack(self, listname, i, stack) -> true/false
static int l_set_stack(lua_State *L);
// get_list(self, listname) -> list or nil
static int l_get_list(lua_State *L);
// set_list(self, listname, list)
static int l_set_list(lua_State *L);
// get_lists(self) -> list of InventoryLists
static int l_get_lists(lua_State *L);
// set_lists(self, lists)
static int l_set_lists(lua_State *L);
// add_item(self, listname, itemstack or itemstring or table or nil) -> itemstack
// Returns the leftover stack
static int l_add_item(lua_State *L);
// room_for_item(self, listname, itemstack or itemstring or table or nil) -> true/false
// Returns true if the item completely fits into the list
static int l_room_for_item(lua_State *L);
// contains_item(self, listname, itemstack or itemstring or table or nil) -> true/false
// Returns true if the list contains the given count of the given item name
static int l_contains_item(lua_State *L);
// remove_item(self, listname, itemstack or itemstring or table or nil) -> itemstack
// Returns the items that were actually removed
static int l_remove_item(lua_State *L);
// get_location() -> location (like get_inventory(location))
static int l_get_location(lua_State *L);
public:
InvRef(const InventoryLocation &loc);
~InvRef();
// Creates an InvRef and leaves it on top of stack
// Not callable from Lua; all references are created on the C side.
static void create(lua_State *L, const InventoryLocation &loc);
static void createPlayer(lua_State *L, Player *player);
static void createNodeMeta(lua_State *L, v3s16 p);
static void Register(lua_State *L);
};
class ModApiInventory : public ModApiBase {
private:
static int l_create_detached_inventory_raw(lua_State *L);
static int l_get_inventory(lua_State *L);
static void inventory_set_list_from_lua(Inventory *inv, const char *name,
lua_State *L, int tableindex, int forcesize);
static void inventory_get_list_to_lua(Inventory *inv, const char *name,
lua_State *L);
public:
static void Initialize(lua_State *L, int top);
};
#endif /* L_INVENTORY_H_ */
|