naev 0.12.6
nlua_pilot.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
7#include <lua.h>
9
10#include "pilot.h"
11
12#define PILOT_METATABLE "pilot"
13
14/* Helper. */
15#define luaL_optpilot( L, ind, def ) \
16 nluaL_optarg( L, ind, def, luaL_validpilot )
17
24typedef unsigned int LuaPilot;
25
26/*
27 * Library loading
28 */
29int nlua_loadPilot( nlua_env env );
30
31/*
32 * Pilot operations
33 */
34LuaPilot lua_topilot( lua_State *L, int ind );
35LuaPilot luaL_checkpilot( lua_State *L, int ind );
36LuaPilot *lua_pushpilot( lua_State *L, LuaPilot pilot );
37Pilot *luaL_validpilot( lua_State *L, int ind );
38int lua_ispilot( lua_State *L, int ind );
LuaPilot lua_topilot(lua_State *L, int ind)
Lua bindings to interact with pilots.
Definition nlua_pilot.c:535
LuaPilot * lua_pushpilot(lua_State *L, LuaPilot pilot)
Pushes a pilot on the stack.
Definition nlua_pilot.c:576
Pilot * luaL_validpilot(lua_State *L, int ind)
Makes sure the pilot is valid or raises a Lua error.
Definition nlua_pilot.c:560
int nlua_loadPilot(nlua_env env)
Loads the pilot library.
Definition nlua_pilot.c:481
int lua_ispilot(lua_State *L, int ind)
Checks to see if ind is a pilot.
Definition nlua_pilot.c:591
LuaPilot luaL_checkpilot(lua_State *L, int ind)
Gets pilot at index or raises error if there is no pilot at index.
Definition nlua_pilot.c:546
The representation of an in-game pilot.
Definition pilot.h:263