The Battle for Wesnoth  1.17.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 ()
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

int num_
int side_


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 

◆ ~lua_ai_context()

ai::lua_ai_context::~lua_ai_context ( )

Definition at line 1076 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

◆ apply_micro_ai()

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

Definition at line 955 of file core.cpp.

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

Referenced by lua_ai_context().

◆ create()

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

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

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

Definition at line 53 of file core.hpp.

◆ lua_ai_load

friend class lua_ai_load

Definition at line 54 of file core.hpp.

Member Data Documentation

◆ L

lua_State* ai::lua_ai_context::L

Definition at line 36 of file core.hpp.

◆ num_

int ai::lua_ai_context::num_

◆ side_

int ai::lua_ai_context::side_

Definition at line 38 of file core.hpp.

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