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

Proxy table for the AI context. More...

#include <core.hpp>

Public Member Functions

 ~lua_ai_context ()
 
void update_state ()
 
void get_persistent_data (config &) const
 
void set_persistent_data (const config &)
 
void get_arguments (config &) const
 
void set_arguments (const config &)
 
void push_ai_table ()
 
void apply_micro_ai (const config &cfg)
 

Static Public Member Functions

static void init (lua_State *L)
 

Private Member Functions

 lua_ai_context (lua_State *l, int num, int side)
 

Static Private Member Functions

static lua_ai_contextcreate (lua_State *L, char const *code, engine_lua *engine)
 

Private Attributes

lua_State * L
 
int num_
 
int side_
 

Friends

class ::game_lua_kernel
 
class lua_ai_load
 

Detailed Description

Proxy table for the AI context.

Definition at line 33 of file core.hpp.

Constructor & Destructor Documentation

◆ lua_ai_context()

ai::lua_ai_context::lua_ai_context ( lua_State *  l,
int  num,
int  side 
)
inlineprivate

Definition at line 39 of file core.hpp.

Referenced by create().

◆ ~lua_ai_context()

ai::lua_ai_context::~lua_ai_context ( )

Definition at line 1092 of file core.cpp.

References aisKey, L, and num_.

Member Function Documentation

◆ apply_micro_ai()

void ai::lua_ai_context::apply_micro_ai ( const config cfg)

Definition at line 971 of file core.cpp.

References L, luaW_getglobal(), luaW_pcall(), and luaW_pushconfig().

◆ create()

lua_ai_context * ai::lua_ai_context::create ( lua_State *  L,
char const *  code,
ai::engine_lua engine 
)
staticprivate

◆ get_arguments()

void ai::lua_ai_context::get_arguments ( config cfg) const

Definition at line 60 of file core.cpp.

References aisKey, L, luaW_toconfig(), and num_.

◆ get_persistent_data()

void ai::lua_ai_context::get_persistent_data ( config cfg) const

Definition at line 86 of file core.cpp.

References aisKey, L, luaW_toconfig(), and num_.

◆ init()

void ai::lua_ai_context::init ( lua_State *  L)
static

Definition at line 53 of file core.cpp.

References aisKey, and L.

Referenced by game_lua_kernel::game_lua_kernel().

◆ push_ai_table()

void ai::lua_ai_context::push_ai_table ( )

Definition at line 123 of file core.cpp.

◆ set_arguments()

void ai::lua_ai_context::set_arguments ( const config cfg)

Definition at line 73 of file core.cpp.

References aisKey, L, luaW_pushconfig(), and num_.

◆ set_persistent_data()

void ai::lua_ai_context::set_persistent_data ( const config cfg)

Definition at line 99 of file core.cpp.

References aisKey, L, luaW_pushconfig(), and num_.

◆ update_state()

void ai::lua_ai_context::update_state ( )

Definition at line 999 of file core.cpp.

References L, and luaW_pcall().

Friends And Related Function Documentation

◆ ::game_lua_kernel

friend class ::game_lua_kernel
friend

Definition at line 53 of file core.hpp.

◆ lua_ai_load

friend class lua_ai_load
friend

Definition at line 54 of file core.hpp.

Member Data Documentation

◆ L

lua_State* ai::lua_ai_context::L
private

◆ num_

int ai::lua_ai_context::num_
private

◆ side_

int ai::lua_ai_context::side_
private

Definition at line 38 of file core.hpp.


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