Freeciv21
Develop your civilization from humble roots to a global empire
taiplayer.h File Reference
#include "fcthread.h"
#include "player.h"
#include "aidata.h"
#include "taimsg.h"
+ Include dependency graph for taiplayer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tai_msgs
 
struct  tai_reqs
 
struct  tai_plr
 

Functions

void tai_init_threading (void)
 Initialize ai thread. More...
 
bool tai_thread_running (void)
 Return whether player thread is running. More...
 
void tai_player_alloc (struct ai_type *ait, struct player *pplayer)
 Initialize player for use with threaded AI. More...
 
void tai_player_free (struct ai_type *ait, struct player *pplayer)
 Free player from use with threaded AI. More...
 
void tai_control_gained (struct ai_type *ait, struct player *pplayer)
 We actually control the player. More...
 
void tai_control_lost (struct ai_type *ait, struct player *pplayer)
 We no longer control the player. More...
 
void tai_refresh (struct ai_type *ait, struct player *pplayer)
 Check for messages sent by player thread. More...
 
void tai_msg_to_thr (struct tai_msg *msg)
 Send message to thread. More...
 
void tai_req_from_thr (struct tai_req *req)
 Thread sends message. More...
 
static struct tai_plrtai_player_data (struct ai_type *ait, const struct player *pplayer)
 

Function Documentation

◆ tai_control_gained()

void tai_control_gained ( struct ai_type ait,
struct player pplayer 
)

We actually control the player.

Definition at line 197 of file taiplayer.c.

Referenced by twai_control_gained().

◆ tai_control_lost()

void tai_control_lost ( struct ai_type ait,
struct player pplayer 
)

We no longer control the player.

Definition at line 218 of file taiplayer.c.

Referenced by twai_control_lost().

◆ tai_init_threading()

void tai_init_threading ( void  )

Initialize ai thread.

Definition at line 61 of file taiplayer.c.

Referenced by tai_init_self().

◆ tai_msg_to_thr()

void tai_msg_to_thr ( struct tai_msg msg)

Send message to thread.

Be sure that thread is running so that messages are not just piling up to the list without anybody reading them.

Definition at line 275 of file taiplayer.c.

Referenced by tai_send_msg().

◆ tai_player_alloc()

void tai_player_alloc ( struct ai_type ait,
struct player pplayer 
)

Initialize player for use with threaded AI.

Definition at line 167 of file taiplayer.c.

Referenced by twai_player_alloc().

◆ tai_player_data()

static struct tai_plr* tai_player_data ( struct ai_type ait,
const struct player pplayer 
)
inlinestatic

Definition at line 57 of file taiplayer.h.

◆ tai_player_free()

void tai_player_free ( struct ai_type ait,
struct player pplayer 
)

Free player from use with threaded AI.

Definition at line 180 of file taiplayer.c.

Referenced by twai_player_free().

◆ tai_refresh()

void tai_refresh ( struct ai_type ait,
struct player pplayer 
)

Check for messages sent by player thread.

Definition at line 239 of file taiplayer.c.

Referenced by twai_refresh().

◆ tai_req_from_thr()

void tai_req_from_thr ( struct tai_req req)

Thread sends message.

Definition at line 285 of file taiplayer.c.

Referenced by tai_send_req().

◆ tai_thread_running()

bool tai_thread_running ( void  )

Return whether player thread is running.

Definition at line 294 of file taiplayer.c.

Referenced by tai_send_msg().