merge 2006-08-29T11:03:56Z!benoit.timbert@free.fr : Now all AIs fire a "ai turn" event.

This commit is contained in:
Benoît Timbert 2006-08-29 11:10:05 +00:00
parent 333e97b0e4
commit a8412af84a
2 changed files with 6 additions and 1 deletions

View File

@ -36,7 +36,9 @@
class idle_ai : public ai_interface {
public:
idle_ai(info& i) : ai_interface(i) {}
void play_turn() {}
void play_turn() {
game_events::fire("ai turn");
}
};
class sample_ai : public ai_interface {
@ -44,6 +46,7 @@ public:
sample_ai(info& i) : ai_interface(i) {}
void play_turn() {
game_events::fire("ai turn");
do_attacks();
get_villages();
do_moves();

View File

@ -1688,6 +1688,8 @@ python_ai::~python_ai()
void python_ai::play_turn()
{
game_events::fire("ai turn");
std::string script_name = current_team().ai_parameters()["python_script"];
std::string script = get_binary_file_location("data", "ais/" + script_name);
PyObject* file = PyFile_FromString((char*)script.c_str(),"rt");