The Battle for Wesnoth  1.19.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 >:

Public Member Functions

 lua_object ()
 
 lua_object (const T &init)
 
std::shared_ptr< T > get ()
 
void store (lua_State *L, int n)
 
void push (lua_State *L)
 
- 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)
 
void from_type (lua_State *L, std::shared_ptr< T >)
 
std::shared_ptr< aspect_attacks_lua_filterto_type (lua_State *L, int n)
 
std::shared_ptr< double > to_type (lua_State *L, int n)
 
void from_type (lua_State *L, std::shared_ptr< double > value)
 
std::shared_ptr< std::string > to_type (lua_State *L, int n)
 
void from_type (lua_State *L, std::shared_ptr< utils::variant< bool, std::vector< std::string >>> value)
 
std::shared_ptr< utils::variant< bool, std::vector< std::string > > > to_type (lua_State *L, int n)
 
void from_type (lua_State *L, std::shared_ptr< std::string > value)
 
std::shared_ptr< bool > to_type (lua_State *L, int n)
 
void from_type (lua_State *L, std::shared_ptr< bool > value)
 
std::shared_ptr< int > to_type (lua_State *L, int n)
 
void from_type (lua_State *L, std::shared_ptr< int > value)
 
std::shared_ptr< std::vector< std::string > > to_type (lua_State *L, int n)
 
void from_type (lua_State *L, std::shared_ptr< std::vector< std::string > > value)
 
std::shared_ptr< configto_type (lua_State *L, int n)
 
void from_type (lua_State *L, std::shared_ptr< config > value)
 
std::shared_ptr< terrain_filterto_type (lua_State *L, int n)
 
void from_type (lua_State *L, std::shared_ptr< terrain_filter > value)
 
std::shared_ptr< std::vector< target > > to_type (lua_State *L, int n)
 
std::shared_ptr< unit_advancements_aspectto_type (lua_State *L, int n)
 
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() [1/2]

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

Definition at line 57 of file lua_object.hpp.

◆ lua_object() [2/2]

template<typename T >
ai::lua_object< T >::lua_object ( const T &  init)
inline

Definition at line 63 of file lua_object.hpp.

Member Function Documentation

◆ from_type() [1/9]

void ai::lua_object< bool >::from_type ( lua_State *  L,
std::shared_ptr< bool >  value 
)
inlineprotected

Definition at line 177 of file lua_object.hpp.

◆ from_type() [2/9]

void ai::lua_object< config >::from_type ( lua_State *  L,
std::shared_ptr< config value 
)
inlineprotected

Definition at line 234 of file lua_object.hpp.

References luaW_pushconfig().

◆ from_type() [3/9]

void ai::lua_object< double >::from_type ( lua_State *  L,
std::shared_ptr< double >  value 
)
inlineprotected

Definition at line 109 of file lua_object.hpp.

◆ from_type() [4/9]

void ai::lua_object< int >::from_type ( lua_State *  L,
std::shared_ptr< int >  value 
)
inlineprotected

Definition at line 190 of file lua_object.hpp.

◆ from_type() [5/9]

void ai::lua_object< std::string >::from_type ( lua_State *  L,
std::shared_ptr< std::string >  value 
)
inlineprotected

Definition at line 164 of file lua_object.hpp.

◆ from_type() [6/9]

void ai::lua_object< std::vector< std::string > >::from_type ( lua_State *  L,
std::shared_ptr< std::vector< std::string > >  value 
)
inlineprotected

Definition at line 214 of file lua_object.hpp.

◆ from_type() [7/9]

template<typename T >
void ai::lua_object< T >::from_type ( lua_State *  L,
std::shared_ptr< T >   
)
inlineprotected

Definition at line 93 of file lua_object.hpp.

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

◆ from_type() [8/9]

void ai::lua_object< terrain_filter >::from_type ( lua_State *  L,
std::shared_ptr< terrain_filter value 
)
inlineprotected

Definition at line 253 of file lua_object.hpp.

References luaW_pushlocation().

◆ from_type() [9/9]

void ai::lua_object< utils::variant< bool, std::vector< std::string > > >::from_type ( lua_State *  L,
std::shared_ptr< utils::variant< bool, std::vector< std::string >>>  value 
)
inlineprotected

Definition at line 122 of file lua_object.hpp.

References utils::decayed_is_same.

◆ get()

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

Definition at line 69 of file lua_object.hpp.

References ai::lua_object< T >::value_.

◆ push()

template<typename T >
void ai::lua_object< T >::push ( lua_State *  L)
inline

◆ store()

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

Implements ai::lua_object_base.

Definition at line 74 of file lua_object.hpp.

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

◆ to_type() [1/13]

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

Definition at line 87 of file lua_object.hpp.

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

◆ to_type() [2/13]

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

Definition at line 38 of file lua_object.cpp.

References luaW_tovconfig(), and n.

◆ to_type() [3/13]

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

Definition at line 103 of file lua_object.hpp.

References n.

◆ to_type() [4/13]

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

Definition at line 116 of file lua_object.hpp.

References n.

◆ to_type() [5/13]

std::shared_ptr< utils::variant< bool, std::vector< std::string > > > ai::lua_object< utils::variant< bool, std::vector< std::string > > >::to_type ( lua_State *  L,
int  n 
)
inlineprotected

Definition at line 143 of file lua_object.hpp.

References i, luaW_toboolean(), n, and s.

◆ to_type() [6/13]

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

Definition at line 171 of file lua_object.hpp.

References luaW_toboolean(), and n.

◆ to_type() [7/13]

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

Definition at line 184 of file lua_object.hpp.

References n.

◆ to_type() [8/13]

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 197 of file lua_object.hpp.

References i, n, and s.

◆ to_type() [9/13]

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

Definition at line 226 of file lua_object.hpp.

References luaW_toconfig(), and n.

◆ to_type() [10/13]

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

Definition at line 241 of file lua_object.hpp.

References resources::filter_con, luaW_tovconfig(), and n.

◆ to_type() [11/13]

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

Definition at line 267 of file lua_object.hpp.

References ERR_OBJ_LUA, string_enums::enum_base< Definition >::get_enum(), i, and n.

◆ to_type() [12/13]

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

Definition at line 324 of file lua_object.hpp.

References n.

◆ to_type() [13/13]

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

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