OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | List of all members
LuaItemQueryTable< ItemType > Class Template Reference

#include <LuaItemQueryTable.h>

Public Member Functions

 LuaItemQueryTable (sol::state_view &luaState)
 
template<typename T >
void add (const std::string_view &key, T &&query)
 
sol::object createTable (const ItemType &item, const QueryTable &queryTable)
 

Private Types

typedef std::unordered_map< std::string, std::function< sol::object(const ItemType &)> > MapFunctions
 

Private Attributes

MapFunctions _mapping
 
sol::state_view _luaState
 

Member Typedef Documentation

◆ MapFunctions

template<typename ItemType >
typedef std::unordered_map<std::string, std::function<sol::object(const ItemType &)> > LuaItemQueryTable< ItemType >::MapFunctions
private

Constructor & Destructor Documentation

◆ LuaItemQueryTable()

template<typename ItemType >
LuaItemQueryTable< ItemType >::LuaItemQueryTable ( sol::state_view &  luaState)
inlineexplicit

Member Function Documentation

◆ add()

template<typename ItemType >
template<typename T >
void LuaItemQueryTable< ItemType >::add ( const std::string_view &  key,
T &&  query 
)
inline

◆ createTable()

template<typename ItemType >
sol::object LuaItemQueryTable< ItemType >::createTable ( const ItemType item,
const QueryTable queryTable 
)
inline

Generate a Lua table by extracting information from the provided item. Treat the query table as a vector, with each item being a string representing the property to extract.

Member Data Documentation

◆ _luaState

template<typename ItemType >
sol::state_view LuaItemQueryTable< ItemType >::_luaState
private

◆ _mapping

template<typename ItemType >
MapFunctions LuaItemQueryTable< ItemType >::_mapping
private

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