The Battle for Wesnoth  1.15.0+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 ()
 

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_StateL
 
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

◆ ~lua_ai_context()

ai::lua_ai_context::~lua_ai_context ( )

Definition at line 1098 of file core.cpp.

References aisKey, lua_getfield(), lua_pop, lua_pushnil(), lua_rawseti(), and LUA_REGISTRYINDEX.

Referenced by lua_ai_context().

Member Function Documentation

◆ 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

◆ get_persistent_data()

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

◆ init()

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

Definition at line 62 of file core.cpp.

References aisKey, lua_newtable, LUA_REGISTRYINDEX, and lua_setfield().

Referenced by game_lua_kernel::game_lua_kernel(), and lua_ai_context().

◆ push_ai_table()

void ai::lua_ai_context::push_ai_table ( )

Definition at line 132 of file core.cpp.

Referenced by lua_ai_context().

◆ set_arguments()

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

◆ set_persistent_data()

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

◆ update_state()

void ai::lua_ai_context::update_state ( )

Definition at line 1005 of file core.cpp.

References lua_getfield(), lua_pop, lua_setfield(), and luaW_pcall().

Referenced by lua_ai_context().

Friends And Related Function Documentation

◆ ::game_lua_kernel

friend class ::game_lua_kernel
friend

Definition at line 52 of file core.hpp.

◆ lua_ai_load

friend class lua_ai_load
friend

Definition at line 53 of file core.hpp.

Member Data Documentation

◆ L

lua_State* ai::lua_ai_context::L
private

Definition at line 36 of file core.hpp.

◆ 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: