naev 0.12.6
nlua_spob.c File Reference

Lua spob module. More...

#include "nlua_spob.h"
#include "array.h"
#include "land.h"
#include "land_outfits.h"
#include "map_overlay.h"
#include "nlua_colour.h"
#include "nlua_commodity.h"
#include "nlua_faction.h"
#include "nlua_outfit.h"
#include "nlua_ship.h"
#include "nlua_system.h"
#include "nlua_tex.h"
#include "nlua_time.h"
#include "nlua_vec2.h"
#include "nluadef.h"
#include "nmath.h"
Include dependency graph for nlua_spob.c:

Go to the source code of this file.

Functions

static int spobL_cur (lua_State *L)
 Gets the current spob - MUST BE LANDED.
static int spobL_get (lua_State *L)
 Gets a spob.
static int spobL_getS (lua_State *L)
 Gets a spob and its corresponding system.
static int spobL_getLandable (lua_State *L)
 Gets a spob only if it's landable.
static int spobL_getAll (lua_State *L)
 Gets all the spobs. Lua function parameter: boolean all_spob Whether or not to get all Spob, including those that may not be located in a system at the time. Lua return parameter: {Spob,...} An ordered list of all the spobs.
static int spobL_system (lua_State *L)
 Gets the system corresponding to a spob. Lua function parameter: Spob p Spob to get system of. Lua return parameter: System|nil The system to which the spob belongs or nil if it has none.
static int spobL_eq (lua_State *L)
 You can use the '==' operator within Lua to compare spobs with this.
static int spobL_name (lua_State *L)
 Gets the spob's translated name.
static int spobL_nameRaw (lua_State *L)
 Gets the spob's raw (untranslated) name.
static int spobL_population (lua_State *L)
 Gets the spob's population.
static int spobL_radius (lua_State *L)
 Gets the spob's radius.
static int spobL_faction (lua_State *L)
 Gets the spob's faction.
static int spobL_reputation (lua_State *L)
 Gets the local reputation of the faction at a spob.
static int spobL_colour (lua_State *L)
 Gets a spob's colour based on its friendliness or hostility to the player.
static int spobL_colourChar (lua_State *L)
 Gets a spob's colour based on its friendliness or hostility to the player.
static int spobL_class (lua_State *L)
 Gets the spob's class.
static int spobL_classLong (lua_State *L)
 Gets the spob's class in long human-readable format already translated.
static int spobL_position (lua_State *L)
 Gets the position of the spob in the system.
static int spobL_services (lua_State *L)
 Checks for spob services.
static int spobL_flags (lua_State *L)
 Checks for spob flags.
static int spobL_canland (lua_State *L)
 Gets whether or not the player can land on the spob (or bribe it).
static int spobL_landAllow (lua_State *L)
 Allows the player land on a spob no matter what. The override lasts until the player jumps or lands.
static int spobL_landDeny (lua_State *L)
 Disallows a player from landing on a spob. The override lasts until the player jumps or lands.
static int spobL_getLandAllow (lua_State *L)
 Gets the land allow override status for a spob.
static int spobL_getLandDeny (lua_State *L)
 Gets the land deny override status for a spob.
static int spobL_gfxSpace (lua_State *L)
 Gets the texture of the spob in space.
static int spobL_gfxExterior (lua_State *L)
 Gets the texture of the spob in exterior.
static int spobL_gfxExteriorPath (lua_State *L)
 Gets the path of the spob in exterior.
static int spobL_gfxComm (lua_State *L)
 Gets the texture of the spob for the communication window.
static int spobL_shipsSold (lua_State *L)
 Gets the ships sold at a spob.
static int spobL_outfitsSold (lua_State *L)
 Gets the outfits sold at a spob.
static int spobL_commoditiesSold (lua_State *L)
 Gets the commodities sold at a spob.
static int spobL_isBlackMarket (lua_State *L)
 Checks to see if a spob is a black market.
static int spobL_isKnown (lua_State *L)
 Checks to see if a spob is known by the player.
static int spobL_setKnown (lua_State *L)
 Sets a spobs's known state.
static int spobL_isHostile (lua_State *L)
 Checks to see if a spob currently has the hostile flag set.
static int spobL_setHostile (lua_State *L)
 Sets the hostile flag of a spob.
static int spobL_recordCommodityPriceAtTime (lua_State *L)
 Records commodity prices at a given time, adding to players stats.
static int spobL_tags (lua_State *L)
 Gets the spob tags.
int nlua_loadSpob (nlua_env env)
 Loads the spob library.
LuaSpob lua_tospob (lua_State *L, int ind)
 This module allows you to handle the spobs from Lua.
LuaSpob luaL_checkspob (lua_State *L, int ind)
 Gets spob at index raising an error if isn't a spob.
SpobluaL_validspob (lua_State *L, int ind)
 Gets a spob directly.
LuaSpob * lua_pushspob (lua_State *L, LuaSpob spob)
 Pushes a spob on the stack.
int lua_isspob (lua_State *L, int ind)
 Checks to see if ind is a spob.
static int spobL_getBackend (lua_State *L, int system, int landable)
static int landAllowDeny (lua_State *L, int allowdeny)

Variables

static const luaL_Reg spob_methods []

Detailed Description

Lua spob module.

Definition in file nlua_spob.c.

Function Documentation

◆ landAllowDeny()

int landAllowDeny ( lua_State * L,
int allowdeny )
static

Definition at line 753 of file nlua_spob.c.

◆ lua_isspob()

int lua_isspob ( lua_State * L,
int ind )

Checks to see if ind is a spob.

Parameters
LLua state to check.
indIndex position to check.
Returns
1 if ind is a spob.

Definition at line 218 of file nlua_spob.c.

◆ lua_pushspob()

LuaSpob * lua_pushspob ( lua_State * L,
LuaSpob spob )

Pushes a spob on the stack.

Parameters
LLua state to push spob into.
spobSpob to push.
Returns
Newly pushed spob.

Definition at line 203 of file nlua_spob.c.

◆ lua_tospob()

LuaSpob lua_tospob ( lua_State * L,
int ind )

This module allows you to handle the spobs from Lua.

Generally you do something like:

p,s = spob.get() -- Get current spob and system
if p:services()["inhabited"] > 0 then -- spob is inhabited
v = p:pos() -- Get the position
-- Do other stuff
end

Lua module: spob

Gets spob at index.

Parameters
LLua state to get spob from.
indIndex position to find the spob.
Returns
Spob found at the index in the state.

Definition at line 152 of file nlua_spob.c.

◆ luaL_checkspob()

LuaSpob luaL_checkspob ( lua_State * L,
int ind )

Gets spob at index raising an error if isn't a spob.

Parameters
LLua state to get spob from.
indIndex position to find the spob.
Returns
Spob found at the index in the state.

Definition at line 163 of file nlua_spob.c.

◆ luaL_validspob()

Spob * luaL_validspob ( lua_State * L,
int ind )

Gets a spob directly.

Parameters
LLua state to get spob from.
indIndex position to find the spob.
Returns
Spob found at the index in the state.

Definition at line 177 of file nlua_spob.c.

◆ nlua_loadSpob()

int nlua_loadSpob ( nlua_env env)

Loads the spob library.

Parameters
envEnvironment to load spob library into.
Returns
0 on success.

Definition at line 124 of file nlua_spob.c.

◆ spobL_canland()

int spobL_canland ( lua_State * L)
static

Gets whether or not the player can land on the spob (or bribe it).

Lua usage parameter: can_land, can_bribe = p:canLand() Lua function parameter: Spob p Spob to get land and bribe status of. Lua return parameter: boolean The land status of the spob.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: canLand

Definition at line 745 of file nlua_spob.c.

◆ spobL_class()

int spobL_class ( lua_State * L)
static

Gets the spob's class.

Usually classes are characters for spobs and numbers for stations.

Lua usage parameter: c = p:class() Lua function parameter: Spob p Spob to get the class of. Lua return parameter: string The class of the spob in a one char identifier.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: class

Definition at line 648 of file nlua_spob.c.

◆ spobL_classLong()

int spobL_classLong ( lua_State * L)
static

Gets the spob's class in long human-readable format already translated.

Lua usage parameter: c = p:classLong() Lua function parameter: Spob p Spob to get the class of. Lua return parameter: string The class of the spob in descriptive form such as "Pelagic".

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: classLong

Definition at line 665 of file nlua_spob.c.

◆ spobL_colour()

int spobL_colour ( lua_State * L)
static

Gets a spob's colour based on its friendliness or hostility to the player.

Lua usage parameter: col = p:colour()

Lua function parameter: Spob spb Spob to get the colour of. Lua return parameter: Colour The spob's colour.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: colour

Definition at line 608 of file nlua_spob.c.

◆ spobL_colourChar()

int spobL_colourChar ( lua_State * L)
static

Gets a spob's colour based on its friendliness or hostility to the player.

Lua usage parameter: col = p:colourChar()

Lua function parameter: Spob spb Spob to get the colour of. Lua return parameter: string The spob's colour character for use with special printing sequences..

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: colourChar

Definition at line 627 of file nlua_spob.c.

◆ spobL_commoditiesSold()

int spobL_commoditiesSold ( lua_State * L)
static

Gets the commodities sold at a spob.

Lua function parameter: Pilot p Spob to get commodities sold at. Lua return parameter: {Commodity,...} An ordered table containing all the commodities sold (empty if none sold).

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: commoditiesSold

Definition at line 981 of file nlua_spob.c.

◆ spobL_cur()

int spobL_cur ( lua_State * L)
static

Gets the current spob - MUST BE LANDED.

Lua usage parameter: p,s = spob.cur() – Gets current spob (assuming landed)

Lua return parameter: Spob The spob the player is landed on. Lua return parameter: System The system it is in.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: cur

Definition at line 243 of file nlua_spob.c.

◆ spobL_eq()

int spobL_eq ( lua_State * L)
static

You can use the '==' operator within Lua to compare spobs with this.

Lua usage parameter: if p.__eq( spob.get( "Anecu" ) ) then – Do something Lua usage parameter: if p == spob.get( "Anecu" ) then – Do something Lua function parameter: Spob p Spob comparing. Lua function parameter: Spob comp spob to compare against. Lua return parameter: boolean true if both spobs are the same.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: __eq

Definition at line 482 of file nlua_spob.c.

◆ spobL_faction()

int spobL_faction ( lua_State * L)
static

Gets the spob's faction.

Lua usage parameter: f = p:faction() Lua function parameter: Spob p Spob to get the faction of. Lua return parameter: Faction The spob's faction, or nil if it has no faction.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: faction

Definition at line 573 of file nlua_spob.c.

◆ spobL_flags()

int spobL_flags ( lua_State * L)
static

Checks for spob flags.

Possible services are:

  • "nomissionspawn"

Lua usage parameter: if p:flags()["nomissionspawn"] then – Spob doesn't spawn missions Lua function parameter: Spob p Spob to get the services of. Lua return parameter: table Table containing all the services.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: services

Definition at line 725 of file nlua_spob.c.

◆ spobL_get()

int spobL_get ( lua_State * L)
static

Gets a spob.

Possible values of param:

  • bool : Gets a random spob.
  • faction : Gets random spob belonging to faction matching the number.
  • string : Gets the spob by raw (untranslated) name.
  • table : Gets random spob belonging to any of the factions in the table.

Lua usage parameter: p = spob.get( "Anecu" ) – Gets spob by name Lua usage parameter: p = spob.get( faction.get( "Empire" ) ) – Gets random Empire spob Lua usage parameter: p = spob.get(true) – Gets completely random spob Lua usage parameter: p = spob.get( { faction.get("Empire"), faction.get("Dvaered") } ) – Random spob belonging to Empire or Dvaered Lua function parameter: boolean|Faction|string|table param See description. Lua return parameter: Spob The matching spob.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: get

Definition at line 384 of file nlua_spob.c.

◆ spobL_getAll()

int spobL_getAll ( lua_State * L)
static

Gets all the spobs. Lua function parameter: boolean all_spob Whether or not to get all Spob, including those that may not be located in a system at the time. Lua return parameter: {Spob,...} An ordered list of all the spobs.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: getAll

Definition at line 438 of file nlua_spob.c.

◆ spobL_getBackend()

int spobL_getBackend ( lua_State * L,
int system,
int landable )
static

Definition at line 255 of file nlua_spob.c.

◆ spobL_getLandable()

int spobL_getLandable ( lua_State * L)
static

Gets a spob only if it's landable.

It works exactly the same as spob.get(), but it can only return landable spobs. So if the target is not landable it returns nil.

Lua function parameter: boolean|Faction|string|table param See spob.get() description. Lua return parameter: Spob The matching spob, if it is landable. Lua return parameter: System The system it is in.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: getLandable

Definition at line 426 of file nlua_spob.c.

◆ spobL_getLandAllow()

int spobL_getLandAllow ( lua_State * L)
static

Gets the land allow override status for a spob.

Lua usage parameter: if p:getLandAllow() then – Player can definitely land. Lua function parameter: Spob p Spob to check. Lua return parameter: b Whether or not the player is always allowed to land.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: getLandAllow

Definition at line 814 of file nlua_spob.c.

◆ spobL_getLandDeny()

int spobL_getLandDeny ( lua_State * L)
static

Gets the land deny override status for a spob.

Lua usage parameter: if p:getLandDeny() then – Player can definitely not land Lua function parameter: Spob p Spob to check. Lua return parameter: b Whether or not the player is always disallowed to land.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: getLandDeny

Definition at line 829 of file nlua_spob.c.

◆ spobL_getS()

int spobL_getS ( lua_State * L)
static

Gets a spob and its corresponding system.

Possible values of param:

  • bool : Gets a random spob.
  • faction : Gets random spob belonging to faction matching the number.
  • string : Gets the spob by raw (untranslated) name.
  • table : Gets random spob belonging to any of the factions in the table.

Lua usage parameter: p,s = spob.get( "Anecu" ) – Gets spob by name Lua usage parameter: p,s = spob.get( faction.get( "Empire" ) ) – Gets random Empire spob Lua usage parameter: p,s = spob.get(true) – Gets completely random spob Lua usage parameter: p,s = spob.get( { faction.get("Empire"), faction.get("Dvaered") } ) – Random spob belonging to Empire or Dvaered Lua function parameter: boolean|Faction|string|table param See description. Lua return parameter: Spob The matching spob. Lua return parameter: System The system it is in.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: getS

Definition at line 410 of file nlua_spob.c.

◆ spobL_gfxComm()

int spobL_gfxComm ( lua_State * L)
static

Gets the texture of the spob for the communication window.

Lua usage parameter: gfx = p:gfxComm() Lua function parameter: Spob p Spob Spob to get texture of. Lua return parameter: Tex The communication texture of the spob.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: gfxComm

Definition at line 916 of file nlua_spob.c.

◆ spobL_gfxExterior()

int spobL_gfxExterior ( lua_State * L)
static

Gets the texture of the spob in exterior.

Lua usage parameter: gfx = p:gfxExterior() Lua function parameter: Spob p Spob Spob to get texture of. Lua return parameter: Tex The exterior texture of the spob.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: gfxExterior

Definition at line 882 of file nlua_spob.c.

◆ spobL_gfxExteriorPath()

int spobL_gfxExteriorPath ( lua_State * L)
static

Gets the path of the spob in exterior.

Lua function parameter: Spob p Spob Spob to get texture of. Lua return parameter: string The path to the exterior texture.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: gfxExteriorPath

Definition at line 901 of file nlua_spob.c.

◆ spobL_gfxSpace()

int spobL_gfxSpace ( lua_State * L)
static

Gets the texture of the spob in space.

Lua usage parameter: gfx = p:gfxSpace() Lua function parameter: Spob p Spob to get texture of. Lua return parameter: Tex The space texture of the spob.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: gfxSpace

Definition at line 859 of file nlua_spob.c.

◆ spobL_isBlackMarket()

int spobL_isBlackMarket ( lua_State * L)
static

Checks to see if a spob is a black market.

Lua usage parameter: b = p:blackmarket()

Lua function parameter: Spob p Spob to check if it's a black market. Lua return parameter: boolean true if the spob is a black market.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: blackmarket

Definition at line 1005 of file nlua_spob.c.

◆ spobL_isHostile()

int spobL_isHostile ( lua_State * L)
static

Checks to see if a spob currently has the hostile flag set.

Lua function parameter: Spob spb Spob to check hostile flag status of. Lua return parameter: boolean Whether or not the spob is hostile.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: hostile

Definition at line 1064 of file nlua_spob.c.

◆ spobL_isKnown()

int spobL_isKnown ( lua_State * L)
static

Checks to see if a spob is known by the player.

Lua usage parameter: b = p:known()

Lua function parameter: Spob p Spob to check if the player knows. Lua return parameter: boolean true if the player knows the spob.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: known

Definition at line 1021 of file nlua_spob.c.

◆ spobL_landAllow()

int spobL_landAllow ( lua_State * L)
static

Allows the player land on a spob no matter what. The override lasts until the player jumps or lands.

Lua usage parameter: p:landAllow( true ) – Player can land on spob p now. Lua function parameter: Spob p Spob to forcibly allow the player to land on. Lua function parameter:[opt=false] boolean b Whether or not the player should be allowed to land, true enables, false disables override. Lua function parameter:[opt=nil] string msg Message to give the player when allowing them to land. Setting a message will bypass any custom Lua, otherwise it'll default to using Lua and, in the case there is no Lua, a default message.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: landAllow

Definition at line 783 of file nlua_spob.c.

◆ spobL_landDeny()

int spobL_landDeny ( lua_State * L)
static

Disallows a player from landing on a spob. The override lasts until the player jumps or lands.

Lua usage parameter: p:landDeny( true ) – Player can land on spob p now. Lua function parameter: Spob p Spob to forcibly disallow the player to land on. Lua function parameter:[opt=false] boolean b Whether or not the player should be disallowed to land, true disables, false disables override. Lua function parameter:[opt=nil] string msg Message to give the player when disallowing them to land. Setting a message will bypass any custom Lua, otherwise it'll default to using Lua and, in the case there is no Lua, a default message.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: landDeny

Definition at line 801 of file nlua_spob.c.

◆ spobL_name()

int spobL_name ( lua_State * L)
static

Gets the spob's translated name.

This translated name should be used for display purposes (e.g. messages). It cannot be used as an identifier for the spob; for that, use spob.nameRaw() instead.

Note that it can be overwritten by the spob's display name which makes it not equivalent to _(p:nameRaw()) in some cases.

Lua usage parameter: name = p:name() Lua function parameter: Spob p Spob to get the translated name of. Lua return parameter: string The translated name of the spob.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: name

See also
nameRaw

Definition at line 507 of file nlua_spob.c.

◆ spobL_nameRaw()

int spobL_nameRaw ( lua_State * L)
static

Gets the spob's raw (untranslated) name.

This untranslated name should be used for identification purposes (e.g. can be passed to spob.get()). It should not be used directly for display purposes without manually translating it with _().

Lua usage parameter: name = p:nameRaw() Lua function parameter: Spob p Spob to get the raw name of. Lua return parameter: string The raw name of the spob.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: nameRaw

Definition at line 526 of file nlua_spob.c.

◆ spobL_outfitsSold()

int spobL_outfitsSold ( lua_State * L)
static

Gets the outfits sold at a spob.

Lua function parameter: Spob p Spob to get outfits sold at. Lua return parameter: {Outfit,...} An ordered table containing all the outfits sold (empty if none sold).

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: outfitsSold

Definition at line 957 of file nlua_spob.c.

◆ spobL_population()

int spobL_population ( lua_State * L)
static

Gets the spob's population.

Lua function parameter: Spob p Spob to get the population of. Lua return parameter: number The spob's population.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: population

Definition at line 540 of file nlua_spob.c.

◆ spobL_position()

int spobL_position ( lua_State * L)
static

Gets the position of the spob in the system.

Lua usage parameter: v = p:pos() Lua function parameter: Spob p Spob to get the position of. Lua return parameter: Vec2 The position of the spob in the system.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: pos

Definition at line 844 of file nlua_spob.c.

◆ spobL_radius()

int spobL_radius ( lua_State * L)
static

Gets the spob's radius.

Lua usage parameter: radius = p:radius() Lua function parameter: Spob p Spob to get the radius of. Lua return parameter: number The spob's graphics radius.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: radius

Definition at line 555 of file nlua_spob.c.

◆ spobL_recordCommodityPriceAtTime()

int spobL_recordCommodityPriceAtTime ( lua_State * L)
static

Records commodity prices at a given time, adding to players stats.

Lua usage parameter: p:recordCommodityPriceAtTime( t ) Lua function parameter: Spob p Spob to record prices at Lua function parameter: ntime_t t Time at which to record prices.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: recordCommodityPriceAtTime

Definition at line 1096 of file nlua_spob.c.

◆ spobL_reputation()

int spobL_reputation ( lua_State * L)
static

Gets the local reputation of the faction at a spob.

Lua function parameter: Spob spb Spob to get the reputation of. Lua return parameter: number The reputation of the player at the space object.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: reputation

Definition at line 589 of file nlua_spob.c.

◆ spobL_services()

int spobL_services ( lua_State * L)
static

Checks for spob services.

Possible services are:

  • "land"
  • "inhabited"
  • "refuel"
  • "bar"
  • "missions"
  • "commodity"
  • "outfits"
  • "shipyard"
  • "blackmarket"

Lua usage parameter: if p:services()["refuel"] then – Spob has refuel service. Lua usage parameter: if p:services()["shipyard"] then – Spob has shipyard service. Lua function parameter: Spob p Spob to get the services of. Lua return parameter: table Table containing all the services.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: services

Definition at line 692 of file nlua_spob.c.

◆ spobL_setHostile()

int spobL_setHostile ( lua_State * L)
static

Sets the hostile flag of a spob.

Lua function parameter: Spob spb Spob to set hostile flag. Lua return parameter: boolean Whether or not to set the hostile status.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: setHostile

Definition at line 1078 of file nlua_spob.c.

◆ spobL_setKnown()

int spobL_setKnown ( lua_State * L)
static

Sets a spobs's known state.

Lua usage parameter: p:setKnown( false ) – Makes spob unknown. Lua function parameter: Spob p Spob to set known. Lua function parameter:[opt=false] boolean b Whether or not to set as known.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: setKnown

Definition at line 1036 of file nlua_spob.c.

◆ spobL_shipsSold()

int spobL_shipsSold ( lua_State * L)
static

Gets the ships sold at a spob.

Lua function parameter: Spob p Spob to get ships sold at. Lua return parameter: {Ship,...} An ordered table containing all the ships sold (empty if none sold).

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: shipsSold

Definition at line 933 of file nlua_spob.c.

◆ spobL_system()

int spobL_system ( lua_State * L)
static

Gets the system corresponding to a spob. Lua function parameter: Spob p Spob to get system of. Lua return parameter: System|nil The system to which the spob belongs or nil if it has none.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: system

Definition at line 460 of file nlua_spob.c.

◆ spobL_tags()

int spobL_tags ( lua_State * L)
static

Gets the spob tags.

Lua usage parameter: if spob.cur():tags()["fancy"] then – Has "fancy" tag

Lua function parameter: Spob p Spob to get tags of. Lua function parameter:[opt=nil] string tag Tag to check if exists. Lua return parameter: table|boolean Table of tags where the name is the key and true is the value or a boolean value if a string is passed as the second parameter indicating whether or not the specified tag exists.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: tags

Definition at line 1116 of file nlua_spob.c.

Variable Documentation

◆ spob_methods

const luaL_Reg spob_methods[]
static

Spob metatable methods.

Definition at line 75 of file nlua_spob.c.