mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 13:05:45 +00:00
merge 2006-08-29T11:03:56Z!benoit.timbert@free.fr : Now all AIs fire a "ai turn" event.
This commit is contained in:
parent
333e97b0e4
commit
a8412af84a
@ -36,7 +36,9 @@
|
|||||||
class idle_ai : public ai_interface {
|
class idle_ai : public ai_interface {
|
||||||
public:
|
public:
|
||||||
idle_ai(info& i) : ai_interface(i) {}
|
idle_ai(info& i) : ai_interface(i) {}
|
||||||
void play_turn() {}
|
void play_turn() {
|
||||||
|
game_events::fire("ai turn");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class sample_ai : public ai_interface {
|
class sample_ai : public ai_interface {
|
||||||
@ -44,6 +46,7 @@ public:
|
|||||||
sample_ai(info& i) : ai_interface(i) {}
|
sample_ai(info& i) : ai_interface(i) {}
|
||||||
|
|
||||||
void play_turn() {
|
void play_turn() {
|
||||||
|
game_events::fire("ai turn");
|
||||||
do_attacks();
|
do_attacks();
|
||||||
get_villages();
|
get_villages();
|
||||||
do_moves();
|
do_moves();
|
||||||
|
@ -1688,6 +1688,8 @@ python_ai::~python_ai()
|
|||||||
|
|
||||||
void python_ai::play_turn()
|
void python_ai::play_turn()
|
||||||
{
|
{
|
||||||
|
game_events::fire("ai turn");
|
||||||
|
|
||||||
std::string script_name = current_team().ai_parameters()["python_script"];
|
std::string script_name = current_team().ai_parameters()["python_script"];
|
||||||
std::string script = get_binary_file_location("data", "ais/" + script_name);
|
std::string script = get_binary_file_location("data", "ais/" + script_name);
|
||||||
PyObject* file = PyFile_FromString((char*)script.c_str(),"rt");
|
PyObject* file = PyFile_FromString((char*)script.c_str(),"rt");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user