Пример #1
0
/**************************************************************************
  We no longer control the player
**************************************************************************/
void tai_control_lost(struct ai_type *ait, struct player *pplayer)
{
  thrai.num_players--;

  log_debug("%s no longer under threaded AI (%d)", pplayer->name, thrai.num_players);

  if (thrai.num_players <= 0) {
    tai_send_msg(TAI_MSG_THR_EXIT, pplayer, NULL);

    fc_thread_wait(&thrai.ait);
    thrai.thread_running = FALSE;

    fc_thread_cond_destroy(&thrai.msgs_to.thr_cond);
    fc_destroy_mutex(&thrai.msgs_to.mutex);
    taimsg_list_destroy(thrai.msgs_to.msglist);
    taireq_list_destroy(thrai.reqs_from.reqlist);
  }
}
Пример #2
0
/**************************************************************************
  Player phase has finished
**************************************************************************/
void tai_phase_finished(struct ai_type *ait, struct player *pplayer)
{
  tai_send_msg(TAI_MSG_PHASE_FINISHED, pplayer, NULL);
}
Пример #3
0
/**************************************************************************
  Time for phase first activities
**************************************************************************/
void tai_first_activities(struct ai_type *ait, struct player *pplayer)
{
  tai_send_msg(TAI_MSG_FIRST_ACTIVITIES, pplayer, NULL);
}