naev 0.11.5
nlua_pilot.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
7#include <lua.h>
10#include "pilot.h"
11
12#define PILOT_METATABLE "pilot"
14/* Helper. */
15#define luaL_optpilot(L,ind,def) nluaL_optarg(L,ind,def,luaL_validpilot)
16
23typedef unsigned int LuaPilot;
25/*
26 * Library loading
27 */
28int nlua_loadPilot( nlua_env env );
29
30/*
31 * Pilot operations
32 */
33LuaPilot lua_topilot( lua_State *L, int ind );
34LuaPilot luaL_checkpilot( lua_State *L, int ind );
35LuaPilot* lua_pushpilot( lua_State *L, LuaPilot pilot );
36Pilot* luaL_validpilot( lua_State *L, int ind );
37int 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:522
LuaPilot * lua_pushpilot(lua_State *L, LuaPilot pilot)
Pushes a pilot on the stack.
Definition nlua_pilot.c:563
Pilot * luaL_validpilot(lua_State *L, int ind)
Makes sure the pilot is valid or raises a Lua error.
Definition nlua_pilot.c:547
int nlua_loadPilot(nlua_env env)
Loads the pilot library.
Definition nlua_pilot.c:468
int lua_ispilot(lua_State *L, int ind)
Checks to see if ind is a pilot.
Definition nlua_pilot.c:578
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:533
The representation of an in-game pilot.
Definition pilot.h:217