/******************************************************************************/
/******************************************************************************/
-#ifndef C_CONTENT_H_
-#define C_CONTENT_H_
+#pragma once
extern "C" {
#include <lua.h>
#include "util/string.h"
#include "itemgroup.h"
#include "itemdef.h"
+#include "c_types.h"
+#include "hud.h"
namespace Json { class Value; }
struct MapNode;
-class INodeDefManager;
+class NodeDefManager;
struct PointedThing;
struct ItemStack;
struct ItemDefinition;
struct EnumString;
struct NoiseParams;
class Schematic;
+class ServerActiveObject;
ContentFeatures read_content_features (lua_State *L, int index);
+void push_content_features (lua_State *L,
+ const ContentFeatures &c);
+
+void push_nodebox (lua_State *L,
+ const NodeBox &box);
+void push_box (lua_State *L,
+ const std::vector<aabb3f> &box);
+
+void push_palette (lua_State *L,
+ const std::vector<video::SColor> *palette);
+
TileDef read_tiledef (lua_State *L, int index,
u8 drawtype);
+
void read_soundspec (lua_State *L, int index,
SimpleSoundSpec &spec);
NodeBox read_nodebox (lua_State *L, int index);
void read_item_definition (lua_State *L, int index, const ItemDefinition &default_def,
ItemDefinition &def);
+void push_item_definition (lua_State *L,
+ const ItemDefinition &i);
+void push_item_definition_full (lua_State *L,
+ const ItemDefinition &i);
+
void read_object_properties (lua_State *L, int index,
+ ServerActiveObject *sao,
ObjectProperties *prop,
IItemDefManager *idef);
void push_object_properties (lua_State *L,
Server *srv, int forcesize=-1);
MapNode readnode (lua_State *L, int index,
- INodeDefManager *ndef);
+ const NodeDefManager *ndef);
void pushnode (lua_State *L, const MapNode &n,
- INodeDefManager *ndef);
+ const NodeDefManager *ndef);
-NodeBox read_nodebox (lua_State *L, int index);
void read_groups (lua_State *L, int index,
ItemGroupList &result);
int index,
Server* srv);
-void read_soundspec (lua_State *L,
- int index,
- SimpleSoundSpec &spec);
+void push_soundspec (lua_State *L,
+ const SimpleSoundSpec &spec);
bool string_to_enum (const EnumString *spec,
int &result,
void read_json_value (lua_State *L, Json::Value &root,
int index, u8 recursion = 0);
-extern struct EnumString es_TileAnimationType[];
+/*!
+ * Pushes a Lua `pointed_thing` to the given Lua stack.
+ * \param csm If true, a client side pointed thing is pushed
+ * \param hitpoint If true, the exact pointing location is also pushed
+ */
+void push_pointed_thing(lua_State *L, const PointedThing &pointed, bool csm =
+ false, bool hitpoint = false);
+
+void push_objectRef (lua_State *L, const u16 id);
+
+void read_hud_element (lua_State *L, HudElement *elem);
-#endif /* C_CONTENT_H_ */
+void push_hud_element (lua_State *L, HudElement *elem);
+
+HudElementStat read_hud_change (lua_State *L, HudElement *elem, void **value);
+
+extern struct EnumString es_TileAnimationType[];