Freeciv21
Develop your civilization from humble roots to a global empire
texaiworld.c File Reference
#include <fc_config.h>
#include "idex.h"
#include "map.h"
#include "world_object.h"
#include "infracache.h"
#include "texaiplayer.h"
#include "texaiworld.h"
+ Include dependency graph for texaiworld.c:

Go to the source code of this file.

Classes

struct  texai_tile_info_msg
 
struct  texai_city_info_msg
 
struct  texai_id_msg
 
struct  texai_unit_info_msg
 
struct  texai_unit_move_msg
 

Functions

void texai_world_init (void)
 Initialize world object for texai. More...
 
void texai_world_close (void)
 Free resources allocated for texai world object. More...
 
void texai_map_init (void)
 Initialize world map for texai. More...
 
struct civ_maptexai_map_get (void)
 Return tex worldmap. More...
 
void texai_map_close (void)
 Free resources allocated for texai world map. More...
 
void texai_tile_info (struct tile *ptile)
 Tile info updated on main map. More...
 
void texai_tile_info_recv (void *data)
 Receive tile update to the thread. More...
 
static void texai_city_update (struct city *pcity, enum texaimsgtype msgtype)
 Send city information to the thread. More...
 
void texai_city_created (struct city *pcity)
 New city has been added to the main map. More...
 
void texai_city_changed (struct city *pcity)
 City on main map has (potentially) changed. More...
 
void texai_city_info_recv (void *data, enum texaimsgtype msgtype)
 Receive city update to the thread. More...
 
struct citytexai_map_city (int city_id)
 Get city from the tex map. More...
 
void texai_city_destroyed (struct city *pcity)
 City has been removed from the main map. More...
 
void texai_city_destruction_recv (void *data)
 Receive city destruction to the thread. More...
 
static void texai_unit_update (struct unit *punit, enum texaimsgtype msgtype)
 Send unit information to the thread. More...
 
void texai_unit_created (struct unit *punit)
 New unit has been added to the main map. More...
 
void texai_unit_changed (struct unit *punit)
 Unit (potentially) changed in main map. More...
 
void texai_unit_info_recv (void *data, enum texaimsgtype msgtype)
 Receive unit update to the thread. More...
 
void texai_unit_destroyed (struct unit *punit)
 Unit has been removed from the main map. More...
 
void texai_unit_destruction_recv (void *data)
 Receive unit destruction to the thread. More...
 
void texai_unit_move_seen (struct unit *punit)
 Unit has moved in the main map. More...
 
void texai_unit_moved_recv (void *data)
 Receive unit move to the thread. More...
 

Variables

static struct world texai_world
 

Function Documentation

◆ texai_city_changed()

void texai_city_changed ( struct city pcity)

City on main map has (potentially) changed.

Definition at line 151 of file texaiworld.c.

Referenced by fc_ai_tex_setup().

◆ texai_city_created()

void texai_city_created ( struct city pcity)

New city has been added to the main map.

Definition at line 143 of file texaiworld.c.

Referenced by fc_ai_tex_setup(), and texai_control_gained().

◆ texai_city_destroyed()

void texai_city_destroyed ( struct city pcity)

City has been removed from the main map.

Definition at line 197 of file texaiworld.c.

Referenced by fc_ai_tex_setup().

◆ texai_city_destruction_recv()

void texai_city_destruction_recv ( void *  data)

Receive city destruction to the thread.

Definition at line 211 of file texaiworld.c.

◆ texai_city_info_recv()

void texai_city_info_recv ( void *  data,
enum texaimsgtype  msgtype 
)

Receive city update to the thread.

Definition at line 159 of file texaiworld.c.

◆ texai_city_update()

static void texai_city_update ( struct city pcity,
enum texaimsgtype  msgtype 
)
static

Send city information to the thread.

Definition at line 126 of file texaiworld.c.

Referenced by texai_city_changed(), and texai_city_created().

◆ texai_map_city()

struct city* texai_map_city ( int  city_id)

Get city from the tex map.

Definition at line 189 of file texaiworld.c.

◆ texai_map_close()

void texai_map_close ( void  )

Free resources allocated for texai world map.

Definition at line 86 of file texaiworld.c.

Referenced by texai_map_free_recv().

◆ texai_map_get()

struct civ_map* texai_map_get ( void  )

Return tex worldmap.

Definition at line 81 of file texaiworld.c.

◆ texai_map_init()

void texai_map_init ( void  )

Initialize world map for texai.

Definition at line 72 of file texaiworld.c.

Referenced by texai_map_alloc_recv(), and texai_thread_start().

◆ texai_tile_info()

void texai_tile_info ( struct tile ptile)

Tile info updated on main map.

Send update to tex map.

Definition at line 91 of file texaiworld.c.

Referenced by fc_ai_tex_setup(), and texai_whole_map_copy().

◆ texai_tile_info_recv()

void texai_tile_info_recv ( void *  data)

Receive tile update to the thread.

Definition at line 108 of file texaiworld.c.

◆ texai_unit_changed()

void texai_unit_changed ( struct unit punit)

Unit (potentially) changed in main map.

Definition at line 256 of file texaiworld.c.

Referenced by fc_ai_tex_setup().

◆ texai_unit_created()

void texai_unit_created ( struct unit punit)

New unit has been added to the main map.

Definition at line 248 of file texaiworld.c.

Referenced by fc_ai_tex_setup(), and texai_control_gained().

◆ texai_unit_destroyed()

void texai_unit_destroyed ( struct unit punit)

Unit has been removed from the main map.

Definition at line 305 of file texaiworld.c.

Referenced by fc_ai_tex_setup().

◆ texai_unit_destruction_recv()

void texai_unit_destruction_recv ( void *  data)

Receive unit destruction to the thread.

Definition at line 319 of file texaiworld.c.

◆ texai_unit_info_recv()

void texai_unit_info_recv ( void *  data,
enum texaimsgtype  msgtype 
)

Receive unit update to the thread.

Definition at line 264 of file texaiworld.c.

◆ texai_unit_move_seen()

void texai_unit_move_seen ( struct unit punit)

Unit has moved in the main map.

Definition at line 341 of file texaiworld.c.

Referenced by fc_ai_tex_setup().

◆ texai_unit_moved_recv()

void texai_unit_moved_recv ( void *  data)

Receive unit move to the thread.

Definition at line 357 of file texaiworld.c.

◆ texai_unit_update()

static void texai_unit_update ( struct unit punit,
enum texaimsgtype  msgtype 
)
static

Send unit information to the thread.

Definition at line 230 of file texaiworld.c.

Referenced by texai_unit_changed(), and texai_unit_created().

◆ texai_world_close()

void texai_world_close ( void  )

Free resources allocated for texai world object.

Definition at line 67 of file texaiworld.c.

Referenced by texai_thread_start().

◆ texai_world_init()

void texai_world_init ( void  )

Initialize world object for texai.

Definition at line 62 of file texaiworld.c.

Referenced by texai_thread_start().

Variable Documentation

◆ texai_world