![]() |
naev 0.10.4
|
Lua jump module. More...
#include "nlua_jump.h"#include "nluadef.h"#include "nlua_vec2.h"#include "nlua_system.h"#include "land_outfits.h"#include "map_overlay.h"#include "log.h"Go to the source code of this file.
Functions | |
| static RETURNS_NONNULL JumpPoint * | luaL_validjumpSystem (lua_State *L, int ind, int *offset) |
| Back-end for luaL_validjump. More... | |
| static int | jumpL_get (lua_State *L) |
| Gets a jump. More... | |
| static int | jumpL_eq (lua_State *L) |
| You can use the '==' operator within Lua to compare jumps with this. More... | |
| static int | jumpL_tostring (lua_State *L) |
| Converts a jump to readable form. Mainly meant to be used for printing. More... | |
| static int | jumpL_radius (lua_State *L) |
| Gets the jump's radius. More... | |
| static int | jumpL_position (lua_State *L) |
| Gets the position of the jump in the system. More... | |
| static int | jumpL_angle (lua_State *L) |
| Gets the angle of a jump in radians. More... | |
| static int | jumpL_hidden (lua_State *L) |
| Checks whether a jump is hidden. More... | |
| static int | jumpL_exitonly (lua_State *L) |
| Checks whether a jump is exit-only. More... | |
| static int | jumpL_system (lua_State *L) |
| Gets the system that a jump point exists in. More... | |
| static int | jumpL_dest (lua_State *L) |
| Gets the system that a jump point exits into. More... | |
| static int | jumpL_isKnown (lua_State *L) |
| Checks to see if a jump is known by the player. More... | |
| static int | jumpL_setKnown (lua_State *L) |
| Sets a jump's known state. More... | |
| int | nlua_loadJump (nlua_env env) |
| Loads the jump library. More... | |
| LuaJump * | lua_tojump (lua_State *L, int ind) |
| This module allows you to handle the jumps from Lua. More... | |
| LuaJump * | luaL_checkjump (lua_State *L, int ind) |
| Gets jump at index raising an error if isn't a jump. More... | |
| JumpPoint * | luaL_validjump (lua_State *L, int ind) |
| Gets a jump directly. More... | |
| LuaJump * | lua_pushjump (lua_State *L, LuaJump jump) |
| Pushes a jump on the stack. More... | |
| int | lua_isjump (lua_State *L, int ind) |
| Checks to see if ind is a jump. More... | |
Variables | |
| static const luaL_Reg | jump_methods [] |
Lua jump module.
Definition in file nlua_jump.c.
|
static |
Gets the angle of a jump in radians.
Lua usage parameter: v = j:angle() Lua function parameter: Jump j Jump to get the angle of. Lua return parameter: number The angle.
| L | Lua State |
Lua function: angle
Definition at line 329 of file nlua_jump.c.
|
static |
Gets the system that a jump point exits into.
Lua usage parameter: v = j:dest() Lua function parameter: Jump j Jump to get the destination of. Lua return parameter: System The jump's destination system.
| L | Lua State |
Lua function: dest
Definition at line 389 of file nlua_jump.c.
|
static |
You can use the '==' operator within Lua to compare jumps with this.
Lua usage parameter: if j:__eq( jump.get( "Rhu", "Ruttwi" ) ) then – Do something Lua function parameter: Jump j Jump comparing. Lua function parameter: Jump comp jump to compare against. Lua return parameter: boolean true if both jumps are the same.
| L | Lua State |
Lua function: __eq
Definition at line 265 of file nlua_jump.c.
|
static |
Checks whether a jump is exit-only.
Lua usage parameter: if jump.exitonly("Eneguoz", "Zied") then – The jump point in Eneguoz cannot be entered. Lua function parameter: Jump j Jump to get the exit-only status of. Lua return parameter: boolean Whether the jump is exit-only.
| L | Lua State |
Lua function: exitonly
Definition at line 359 of file nlua_jump.c.
|
static |
Gets a jump.
Possible values of params:
Lua usage parameter: j,r = jump.get( "Ogat", "Goddard" ) – Returns the Ogat to Goddard and Goddard to Ogat jumps. Lua function parameter: string|System src See description. Lua function parameter: string|System dest See description. Lua return parameter: Jump Returns the jump. Lua return parameter: Jump Returns the inverse.
| L | Lua State |
Lua function: get
Definition at line 228 of file nlua_jump.c.
|
static |
Checks whether a jump is hidden.
Lua usage parameter: if not j:hidden() then – Exclude hidden jumps. Lua function parameter: Jump j Jump to get the hidden status of. Lua return parameter: boolean Whether the jump is hidden.
| L | Lua State |
Lua function: hidden
Definition at line 344 of file nlua_jump.c.
|
static |
Checks to see if a jump is known by the player.
Lua usage parameter: b = j:known()
Lua function parameter: Jump j Jump to check if the player knows. Lua return parameter: boolean true if the player knows the jump.
| L | Lua State |
Lua function: known
Definition at line 405 of file nlua_jump.c.
|
static |
Gets the position of the jump in the system.
Lua usage parameter: v = j:pos() Lua function parameter: Jump j Jump to get the position of. Lua return parameter: Vec2 The position of the jump in the system.
| L | Lua State |
Lua function: pos
Definition at line 314 of file nlua_jump.c.
|
static |
Gets the jump's radius.
Lua usage parameter: radius = j:radius() Lua function parameter: Jump j Jump to get the radius of. Lua return parameter: number The jump's radius.
| L | Lua State |
Lua function: radius
Definition at line 299 of file nlua_jump.c.
|
static |
Sets a jump's known state.
Lua usage parameter: j:setKnown( false ) – Makes jump unknown. Lua function parameter: Jump j Jump to set known. Lua function parameter:[opt=true] boolean value Whether or not to set as known.
| L | Lua State |
Lua function: setKnown
Definition at line 420 of file nlua_jump.c.
|
static |
Gets the system that a jump point exists in.
Lua usage parameter: s = j:system() Lua function parameter: Jump j Jump to get the system of. Lua return parameter: System The jump's system.
| L | Lua State |
Lua function: system
Definition at line 374 of file nlua_jump.c.
|
static |
Converts a jump to readable form. Mainly meant to be used for printing.
Lua function parameter: Jump j Jump to print.
| L | Lua State |
Lua function: __tostring
Definition at line 280 of file nlua_jump.c.
| int lua_isjump | ( | lua_State * | L, |
| int | ind | ||
| ) |
Checks to see if ind is a jump.
| L | Lua state to check. |
| ind | Index to check. |
Definition at line 198 of file nlua_jump.c.
Pushes a jump on the stack.
| L | Lua state to push jump into. |
| jump | Jump to push. |
Definition at line 182 of file nlua_jump.c.
| LuaJump * lua_tojump | ( | lua_State * | L, |
| int | ind | ||
| ) |
This module allows you to handle the jumps from Lua.
Generally you do something like:
Lua module: jump
Gets jump at index.
| L | Lua state to get jump from. |
| ind | Index position to find the jump. |
Definition at line 89 of file nlua_jump.c.
| LuaJump * luaL_checkjump | ( | lua_State * | L, |
| int | ind | ||
| ) |
Gets jump at index raising an error if isn't a jump.
| L | Lua state to get jump from. |
| ind | Index to check. |
Definition at line 100 of file nlua_jump.c.
| JumpPoint * luaL_validjump | ( | lua_State * | L, |
| int | ind | ||
| ) |
Gets a jump directly.
| L | Lua state to get jump from. |
| ind | Index to check. |
Definition at line 170 of file nlua_jump.c.
|
static |
Back-end for luaL_validjump.
| L | Lua state to get jump from. | |
| ind | Index to check. | |
| [out] | offset | How many Lua arguments were passed. |
Definition at line 118 of file nlua_jump.c.
| int nlua_loadJump | ( | nlua_env | env | ) |
Loads the jump library.
| env | Environment to load jump library into. |
Definition at line 61 of file nlua_jump.c.
|
static |
Jump metatable methods.
Definition at line 39 of file nlua_jump.c.