naev 0.12.5
nlua_munition.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
7#include <lua.h>
9
10#include "weapon.h"
11
12#define MUNITION_METATABLE "munition"
13
17typedef struct LuaMunition_ {
18 unsigned int id;
19 size_t idx;
21
22/*
23 * Library loading
24 */
25int nlua_loadMunition( nlua_env env );
26
27/*
28 * Munition operations
29 */
30LuaMunition *lua_tomunition( lua_State *L, int ind );
31LuaMunition *luaL_checkmunition( lua_State *L, int ind );
32LuaMunition *lua_pushmunition( lua_State *L, const Weapon *w );
33Weapon *luaL_validmunition( lua_State *L, int ind );
34int lua_ismunition( lua_State *L, int ind );
int nlua_loadMunition(nlua_env env)
Loads the munition library.
int lua_ismunition(lua_State *L, int ind)
Checks to see if ind is a munition.
LuaMunition * lua_tomunition(lua_State *L, int ind)
Lua bindings to interact with munitions.
LuaMunition * luaL_checkmunition(lua_State *L, int ind)
Gets munition at index or raises error if there is no munition at index.
Weapon * luaL_validmunition(lua_State *L, int ind)
Makes sure the munition is valid or raises a Lua error.
LuaMunition * lua_pushmunition(lua_State *L, const Weapon *w)
Pushes a weapon as a munition on the stack.
Lua Munition wrapper.
unsigned int id
In-game representation of a weapon.
Definition weapon.h:48