The Battle for Wesnoth  1.15.1+dev
Classes | Namespaces | Functions
lua_terrainmap.hpp File Reference
#include <cstddef>
#include <string>
#include "scripting/lua_common.hpp"
#include "map/location.hpp"
#include "terrain/translation.hpp"
#include "terrain/type_data.hpp"
Include dependency graph for lua_terrainmap.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mapgen_gamemap
 

Namespaces

 lua_terrainmap
 

Functions

bool luaW_isslocs (lua_State *L, int index)
 
mapgen_gamemapluaW_toslocs (lua_State *L, int index)
 
mapgen_gamemapluaW_check_slocs (lua_State *L, int index)
 
void lua_slocs_setmetatable (lua_State *L)
 
void luaW_pushslocs (lua_State *L, int index)
 index the index of the map object. More...
 
int impl_slocs_get (lua_State *L)
 
int impl_slocs_set (lua_State *L)
 
bool luaW_isterrainmap (lua_State *L, int index)
 
mapgen_gamemapluaW_toterrainmap (lua_State *L, int index)
 
mapgen_gamemapluaW_checkterrainmap (lua_State *L, int index)
 
void lua_terrainmap_setmetatable (lua_State *L)
 
mapgen_gamemapluaW_pushmap (lua_State *L, mapgen_gamemap &&u)
 
int intf_terainmap_create (lua_State *L)
 Create a map. More...
 
std::string lua_terrainmap::register_metatables (lua_State *L)
 

Function Documentation

◆ impl_slocs_get()

int impl_slocs_get ( lua_State L)

◆ impl_slocs_set()

int impl_slocs_set ( lua_State L)

◆ intf_terainmap_create()

int intf_terainmap_create ( lua_State L)

Create a map.

  • Arg 1: string descripbing the map data.
  • or:
  • Arg 1: int, width
  • Arg 2: int, height
  • Arg 3: string, terrain

Definition at line 237 of file lua_terrainmap.cpp.

References mapgen_gamemap::h(), lua_isnumber(), lua_tonumber, luaL_checkstring, luaW_pushmap(), t_translation::read_terrain_code(), gui2::terrain, and mapgen_gamemap::w().

Referenced by mapgen_lua_kernel::mapgen_lua_kernel().

◆ lua_slocs_setmetatable()

void lua_slocs_setmetatable ( lua_State L)

Definition at line 66 of file lua_terrainmap.cpp.

References luaL_setmetatable(), and maplocationKey.

◆ lua_terrainmap_setmetatable()

void lua_terrainmap_setmetatable ( lua_State L)

Definition at line 216 of file lua_terrainmap.cpp.

References luaL_setmetatable(), and terrinmapKey.

Referenced by luaW_pushmap().

◆ luaW_check_slocs()

mapgen_gamemap& luaW_check_slocs ( lua_State L,
int  index 
)

Definition at line 57 of file lua_terrainmap.cpp.

References luaW_toslocs(), and luaW_type_error().

Referenced by impl_slocs_get(), and impl_slocs_set().

◆ luaW_checkterrainmap()

mapgen_gamemap& luaW_checkterrainmap ( lua_State L,
int  index 
)

◆ luaW_isslocs()

bool luaW_isslocs ( lua_State L,
int  index 
)

Definition at line 39 of file lua_terrainmap.cpp.

References luaL_testudata(), and maplocationKey.

◆ luaW_isterrainmap()

bool luaW_isterrainmap ( lua_State L,
int  index 
)

Definition at line 193 of file lua_terrainmap.cpp.

References luaL_testudata(), and terrinmapKey.

Referenced by luaW_checkterrainmap(), and luaW_toterrainmap().

◆ luaW_pushmap()

mapgen_gamemap* luaW_pushmap ( lua_State L,
mapgen_gamemap &&  u 
)

◆ luaW_pushslocs()

void luaW_pushslocs ( lua_State L,
int  index 
)

index the index of the map object.

Definition at line 73 of file lua_terrainmap.cpp.

References lua_createtable(), lua_pushvalue(), lua_rawseti(), lua_remove, luaL_setmetatable(), and maplocationKey.

Referenced by impl_terainmap_get().

◆ luaW_toslocs()

mapgen_gamemap* luaW_toslocs ( lua_State L,
int  index 
)

Definition at line 45 of file lua_terrainmap.cpp.

References lua_istable, lua_pop, lua_rawgeti(), and luaW_toterrainmap().

Referenced by luaW_check_slocs().

◆ luaW_toterrainmap()

mapgen_gamemap* luaW_toterrainmap ( lua_State L,
int  index 
)

Definition at line 199 of file lua_terrainmap.cpp.

References lua_touserdata(), and luaW_isterrainmap().

Referenced by luaW_toslocs().