The Battle for Wesnoth  1.17.10+dev
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
ai::lua_ai_action_handler Class Reference

Proxy class for calling AI action handlers defined in Lua. More...

#include <core.hpp>

Public Member Functions

 ~lua_ai_action_handler ()
void handle (const config &cfg, const config &filter_own, bool read_only, lua_object_ptr l_obj)

Private Member Functions

 lua_ai_action_handler (lua_State *l, lua_ai_context &context, int num)

Static Private Member Functions

static lua_ai_action_handlercreate (lua_State *L, char const *code, lua_ai_context &context)

Private Attributes

lua_State * L
int num_


class ::game_lua_kernel

Detailed Description

Proxy class for calling AI action handlers defined in Lua.

Definition at line 70 of file core.hpp.

Constructor & Destructor Documentation

◆ lua_ai_action_handler()

ai::lua_ai_action_handler::lua_ai_action_handler ( lua_State *  l,
lua_ai_context context,
int  num 

Definition at line 76 of file core.hpp.

References ai::lua_ai_context::create().

◆ ~lua_ai_action_handler()

ai::lua_ai_action_handler::~lua_ai_action_handler ( )

Definition at line 1141 of file core.cpp.

References aisKey.

Member Function Documentation

◆ create()

lua_ai_action_handler * ai::lua_ai_action_handler::create ( lua_State *  L,
char const *  code,
lua_ai_context context 

Definition at line 1027 of file core.cpp.

References aisKey, ERR_LUA, and ai::lua_ai_load::refcount.

Referenced by game_lua_kernel::create_lua_ai_action_handler().

◆ handle()

void ai::lua_ai_action_handler::handle ( const config cfg,
const config filter_own,
bool  read_only,
lua_object_ptr  l_obj 

Definition at line 1108 of file core.cpp.

References aisKey, config::empty(), luaW_pcall(), and luaW_pushconfig().

Friends And Related Function Documentation

◆ ::game_lua_kernel

friend class ::game_lua_kernel

Definition at line 84 of file core.hpp.

Member Data Documentation

◆ context_

lua_ai_context& ai::lua_ai_action_handler::context_

Definition at line 74 of file core.hpp.

◆ L

lua_State* ai::lua_ai_action_handler::L

Definition at line 73 of file core.hpp.

◆ num_

int ai::lua_ai_action_handler::num_

Definition at line 75 of file core.hpp.

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