The Battle for Wesnoth  1.15.0+dev
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ai::lua_object< T > Class Template Reference

#include <lua_object.hpp>

Inheritance diagram for ai::lua_object< T >:
Inheritance graph

Public Member Functions

 lua_object ()
 
std::shared_ptr< T > get ()
 
void store (lua_State *L, int n)
 
- Public Member Functions inherited from ai::lua_object_base
 lua_object_base ()
 
virtual ~lua_object_base ()
 

Protected Member Functions

std::shared_ptr< T > to_type (lua_State *, int)
 
template<>
std::shared_ptr< aspect_attacks_lua_filterto_type (lua_State *L, int n)
 
template<>
std::shared_ptr< double > to_type (lua_State *L, int n)
 
template<>
std::shared_ptr< std::string > to_type (lua_State *L, int n)
 
template<>
std::shared_ptr< bool > to_type (lua_State *L, int n)
 
template<>
std::shared_ptr< int > to_type (lua_State *L, int n)
 
template<>
std::shared_ptr< std::vector< std::string > > to_type (lua_State *L, int n)
 
template<>
std::shared_ptr< configto_type (lua_State *L, int n)
 
template<>
std::shared_ptr< terrain_filterto_type (lua_State *L, int n)
 
template<>
std::shared_ptr< std::vector< target > > to_type (lua_State *L, int n)
 
template<>
std::shared_ptr< unit_advancements_aspectto_type (lua_State *L, int n)
 
template<>
std::shared_ptr< aspect_attacks_lua_filterto_type (lua_State *L, int n)
 

Protected Attributes

std::shared_ptr< T > value_
 

Detailed Description

template<typename T>
class ai::lua_object< T >

Definition at line 52 of file lua_object.hpp.

Constructor & Destructor Documentation

◆ lua_object()

template<typename T >
ai::lua_object< T >::lua_object ( )
inline

Definition at line 57 of file lua_object.hpp.

Member Function Documentation

◆ get()

template<typename T >
std::shared_ptr<T> ai::lua_object< T >::get ( )
inline

Definition at line 63 of file lua_object.hpp.

◆ store()

template<typename T >
void ai::lua_object< T >::store ( lua_State L,
int  n 
)
inlinevirtual

Implements ai::lua_object_base.

Definition at line 68 of file lua_object.hpp.

References lua_absindex().

◆ to_type() [1/12]

template<>
std::shared_ptr< aspect_attacks_lua_filter > ai::lua_object< aspect_attacks_lua_filter >::to_type ( lua_State L,
int  n 
)
protected

◆ to_type() [2/12]

template<typename T >
std::shared_ptr<T> ai::lua_object< T >::to_type ( lua_State ,
int   
)
inlineprotected

Definition at line 76 of file lua_object.hpp.

Referenced by ai::lua_object< T >::to_type().

◆ to_type() [3/12]

template<>
std::shared_ptr< double > ai::lua_object< double >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 85 of file lua_object.hpp.

References lua_tonumber.

◆ to_type() [4/12]

template<>
std::shared_ptr< std::string > ai::lua_object< std::string >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 91 of file lua_object.hpp.

References lua_tostring.

◆ to_type() [5/12]

template<>
std::shared_ptr< bool > ai::lua_object< bool >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 97 of file lua_object.hpp.

References luaW_toboolean().

◆ to_type() [6/12]

template<>
std::shared_ptr< int > ai::lua_object< int >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 103 of file lua_object.hpp.

References lua_tointeger.

◆ to_type() [7/12]

template<>
std::shared_ptr< std::vector< std::string > > ai::lua_object< std::vector< std::string > >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 109 of file lua_object.hpp.

References i, lua_gettable(), lua_pushinteger(), lua_rawlen(), lua_settop(), lua_tostring, and s.

◆ to_type() [8/12]

template<>
std::shared_ptr< config > ai::lua_object< config >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 126 of file lua_object.hpp.

References luaW_toconfig().

◆ to_type() [9/12]

template<>
std::shared_ptr< terrain_filter > ai::lua_object< terrain_filter >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 134 of file lua_object.hpp.

References resources::filter_con, and luaW_tovconfig().

◆ to_type() [10/12]

template<>
std::shared_ptr< std::vector< target > > ai::lua_object< std::vector< target > >::to_type ( lua_State L,
int  n 
)
inlineprotected

◆ to_type() [11/12]

template<>
std::shared_ptr< unit_advancements_aspect > ai::lua_object< unit_advancements_aspect >::to_type ( lua_State L,
int  n 
)
inlineprotected

Definition at line 196 of file lua_object.hpp.

References n, and ai::lua_object< T >::to_type().

◆ to_type() [12/12]

template<>
std::shared_ptr< aspect_attacks_lua_filter > ai::lua_object< aspect_attacks_lua_filter >::to_type ( lua_State L,
int  n 
)
protected

Member Data Documentation

◆ value_

template<typename T >
std::shared_ptr<T> ai::lua_object< T >::value_
protected

Definition at line 81 of file lua_object.hpp.


The documentation for this class was generated from the following file: