Freeciv-3.3: /fast/freeciv/nightly/main/ai/tex/texaiplayer.h File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Functions
texaiplayer.h File Reference
`#include "fcthread.h"`
`#include "player.h"`
`#include "daidata.h"`
`#include "texaimsg.h"`

Go to the source code of this file.

## Data Structures

struct | texai_msgs
struct | texai_reqs
struct | texai_plr

## Functions

struct ai_type * | texai_get_self (void)
void | texai_init_threading (void)
bool | texai_thread_running (void)
void | texai_map_alloc (void)
void | texai_whole_map_copy (void)
void | texai_map_free (void)
void | texai_player_alloc (struct ai_type *ait, struct player *pplayer)
void | texai_player_free (struct ai_type *ait, struct player *pplayer)
void | texai_control_gained (struct ai_type *ait, struct player *pplayer)
void | texai_control_lost (struct ai_type *ait, struct player *pplayer)
void | texai_refresh (struct ai_type *ait, struct player *pplayer)
void | texai_msg_to_thr (struct texai_msg *msg)
void | texai_req_from_thr (struct texai_req *req)
static struct texai_plr * | texai_player_data (struct ai_type *ait, const struct player *pplayer)
struct unit_list * | texai_player_units (struct player *pplayer)

## Function Documentation

## ◆ texai_control_gained()

void texai_control_gained | ( | struct ai_type * | ait,
|  | struct player * | pplayer
| ) |  |

We actually control the player

Definition at line 312 of file texaiplayer.c.

Referenced by texwai_control_gained().

## ◆ texai_control_lost()

void texai_control_lost | ( | struct ai_type * | ait,
|  | struct player * | pplayer
| ) |  |

We no longer control the player

Definition at line 343 of file texaiplayer.c.

Referenced by texwai_control_lost().

## ◆ texai_get_self()

struct ai_type * texai_get_self | ( | void |  | ) |

Get pointer to ai type of the tex ai.

Definition at line 61 of file texai.c.

Referenced by texai_city_destruction_recv(), texai_city_info_recv(), texai_player_units(), texai_unit_destruction_recv(), and texai_unit_info_recv().

## ◆ texai_init_threading()

void texai_init_threading | ( | void |  | ) |

Initialize ai thread.

Definition at line 73 of file texaiplayer.c.

Referenced by texai_init_self().

## ◆ texai_map_alloc()

void texai_map_alloc | ( | void |  | ) |

Main map has been allocated

Definition at line 114 of file texaiplayer.c.

Referenced by fc_ai_tex_setup().

## ◆ texai_map_free()

void texai_map_free | ( | void |  | ) |

Main map has been freed

Definition at line 140 of file texaiplayer.c.

Referenced by fc_ai_tex_setup().

## ◆ texai_msg_to_thr()

void texai_msg_to_thr | ( | struct texai_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 414 of file texaiplayer.c.

Referenced by texai_send_msg().

## ◆ texai_player_alloc()

void texai_player_alloc | ( | struct ai_type * | ait,
|  | struct player * | pplayer
| ) |  |

Initialize player for use with tex AI.

Definition at line 278 of file texaiplayer.c.

Referenced by texwai_player_alloc().

## ◆ texai_player_data()

static struct texai_plr * texai_player_data | ( | struct ai_type * | ait,
|  | const struct player * | pplayer
| ) |  |

inlinestatic

Definition at line 68 of file texaiplayer.h.

## ◆ texai_player_free()

void texai_player_free | ( | struct ai_type * | ait,
|  | struct player * | pplayer
| ) |  |

Free player from use with tex AI.

Definition at line 294 of file texaiplayer.c.

Referenced by texwai_player_free().

## ◆ texai_player_units()

struct unit_list * texai_player_units | ( | struct player * | pplayer | ) |

Callback that returns unit list from player tex ai data.

Definition at line 156 of file texaiplayer.c.

Referenced by texai_check_messages(), and texai_city_worker_task_select().

## ◆ texai_refresh()

void texai_refresh | ( | struct ai_type * | ait,
|  | struct player * | pplayer
| ) |  |

Check for messages sent by player thread

Definition at line 366 of file texaiplayer.c.

Referenced by texwai_refresh().

## ◆ texai_req_from_thr()

void texai_req_from_thr | ( | struct texai_req * | req | ) |

Thread sends message.

Definition at line 425 of file texaiplayer.c.

Referenced by texai_send_req().

## ◆ texai_thread_running()

bool texai_thread_running | ( | void |  | ) |

Return whether player thread is running

Definition at line 435 of file texaiplayer.c.

Referenced by texai_city_destroyed(), texai_city_update(), texai_send_msg(), texai_tile_info(), texai_unit_destroyed(), texai_unit_move_seen(), and texai_unit_update().

## ◆ texai_whole_map_copy()

void texai_whole_map_copy | ( | void |  | ) |

Send all tiles to tex thread

Definition at line 122 of file texaiplayer.c.

Referenced by fc_ai_tex_setup().