#include <engine_lua.hpp>


Public Member Functions | |
| engine_lua (readonly_context &context, const config &cfg) | |
| Note that initially we get access only to readonly context (engine is created rather early, when there's no way to move/attack. | |
| virtual | ~engine_lua () |
| virtual void | do_parse_candidate_action_from_config (rca_context &context, const config &cfg, std::back_insert_iterator< std::vector< candidate_action_ptr > > b) |
| Taka a config (with engine=lua in it) and parse several (usually, 1) candidate actions out of it. | |
| virtual void | do_parse_stage_from_config (ai_context &context, const config &cfg, std::back_insert_iterator< std::vector< stage_ptr > > b) |
| Taka a config (with engine=lua in it) and parse several (usually, 1) stages out of it. | |
| virtual void | do_parse_aspect_from_config (const config &cfg, const std::string &id, std::back_insert_iterator< std::vector< aspect_ptr > > b) |
| Taka a config (with engine=lua in it) and parse several (usually, 1) aspects out of it. | |
| virtual void | do_parse_goal_from_config (const config &cfg, std::back_insert_iterator< std::vector< goal_ptr > > b) |
| virtual std::string | evaluate (const std::string &str) |
| virtual config | to_config () const |
| Serialize to config. | |
Private Attributes | |
| std::string | code_ |
| Method to inject AI context into the engine. | |
| boost::shared_ptr< lua_ai_context > | lua_ai_context_ |
Definition at line 31 of file engine_lua.hpp.
| ai::engine_lua::engine_lua | ( | readonly_context & | context, | |
| const config & | cfg | |||
| ) |
Note that initially we get access only to readonly context (engine is created rather early, when there's no way to move/attack.
We inject full ai_context later.
Definition at line 173 of file engine_lua.cpp.
| ai::engine_lua::~engine_lua | ( | ) | [virtual] |
Definition at line 186 of file engine_lua.cpp.
| void ai::engine_lua::do_parse_aspect_from_config | ( | const config & | cfg, | |
| const std::string & | id, | |||
| std::back_insert_iterator< std::vector< aspect_ptr > > | b | |||
| ) | [virtual] |
Taka a config (with engine=lua in it) and parse several (usually, 1) aspects out of it.
Reimplemented from ai::engine.
Definition at line 232 of file engine_lua.cpp.
| void ai::engine_lua::do_parse_candidate_action_from_config | ( | rca_context & | context, | |
| const config & | cfg, | |||
| std::back_insert_iterator< std::vector< candidate_action_ptr > > | b | |||
| ) | [virtual] |
Taka a config (with engine=lua in it) and parse several (usually, 1) candidate actions out of it.
Reimplemented from ai::engine.
Definition at line 191 of file engine_lua.cpp.
| void ai::engine_lua::do_parse_goal_from_config | ( | const config & | cfg, | |
| std::back_insert_iterator< std::vector< goal_ptr > > | b | |||
| ) | [virtual] |
Reimplemented from ai::engine.
Definition at line 251 of file engine_lua.cpp.
| void ai::engine_lua::do_parse_stage_from_config | ( | ai_context & | context, | |
| const config & | cfg, | |||
| std::back_insert_iterator< std::vector< stage_ptr > > | b | |||
| ) | [virtual] |
Taka a config (with engine=lua in it) and parse several (usually, 1) stages out of it.
Reimplemented from ai::engine.
Definition at line 215 of file engine_lua.cpp.
| std::string ai::engine_lua::evaluate | ( | const std::string & | str | ) | [virtual] |
Reimplemented from ai::engine.
Definition at line 270 of file engine_lua.cpp.
References ai::engine::ai_, DBG_AI_LUA, ERR_AI_LUA, and ai::side_context::get_side().

| config ai::engine_lua::to_config | ( | ) | const [virtual] |
std::string ai::engine_lua::code_ [private] |
Method to inject AI context into the engine.
The context includes all that in necessary for the AI - , like access to game state and movement/attack routines. The underlying lua code
Definition at line 76 of file engine_lua.hpp.
boost::shared_ptr<lua_ai_context> ai::engine_lua::lua_ai_context_ [private] |
Definition at line 79 of file engine_lua.hpp.
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:18:26 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |