Freeciv-3.2
Loading...
Searching...
No Matches
Functions
idex.h File Reference
#include "fc_types.h"

Go to the source code of this file.

Functions

void idex_init (struct world *iworld)
 
void idex_free (struct world *iworld)
 
void idex_register_city (struct world *iworld, struct city *pcity)
 
void idex_register_unit (struct world *iworld, struct unit *punit)
 
void idex_unregister_city (struct world *iworld, struct city *pcity)
 
void idex_unregister_unit (struct world *iworld, struct unit *punit)
 
struct cityidex_lookup_city (struct world *iworld, int id)
 
struct unitidex_lookup_unit (struct world *iworld, int id)
 

Function Documentation

◆ idex_free()

void idex_free ( struct world iworld)

Free the hashes.

Definition at line 54 of file idex.c.

Referenced by game_free(), game_reset(), and texai_world_close().

◆ idex_init()

void idex_init ( struct world iworld)

Initialize. Should call this at the start before use.

Definition at line 45 of file idex.c.

Referenced by game_init(), game_reset(), and texai_world_init().

◆ idex_lookup_city()

struct city * idex_lookup_city ( struct world iworld,
int  id 
)

Lookup city with given id. Returns NULL if the city is not registered (which is not an error).

Definition at line 133 of file idex.c.

Referenced by api_find_city(), game_city_by_number(), player_city_by_number(), texai_city_destruction_recv(), texai_city_info_recv(), and texai_map_city().

◆ idex_lookup_unit()

struct unit * idex_lookup_unit ( struct world iworld,
int  id 
)

Lookup unit with given id. Returns NULL if the unit is not registered (which is not an error).

Definition at line 146 of file idex.c.

Referenced by api_find_unit(), game_unit_by_number(), player_unit_by_number(), texai_unit_destruction_recv(), texai_unit_info_recv(), and texai_unit_moved_recv().

◆ idex_register_city()

void idex_register_city ( struct world iworld,
struct city pcity 
)

Register a city into idex, with current pcity->id. Call this when pcity created.

Definition at line 67 of file idex.c.

Referenced by create_city(), handle_city_info(), handle_city_short_info(), handle_tile_info(), sg_load_player_cities(), sg_load_player_cities(), and texai_city_info_recv().

◆ idex_register_unit()

void idex_register_unit ( struct world iworld,
struct unit punit 
)

Register a unit into idex, with current punit->id. Call this when punit created.

Definition at line 82 of file idex.c.

Referenced by handle_unit_packet_common(), place_unit(), sg_load_player_units(), sg_load_player_units(), and texai_unit_info_recv().

◆ idex_unregister_city()

void idex_unregister_city ( struct world iworld,
struct city pcity 
)

Remove a city from idex, with current pcity->id. Call this when pcity deleted.

Definition at line 97 of file idex.c.

Referenced by game_remove_city(), packhand_free(), and texai_city_destruction_recv().

◆ idex_unregister_unit()

void idex_unregister_unit ( struct world iworld,
struct unit punit 
)

Remove a unit from idex, with current punit->id. Call this when punit deleted.

Definition at line 115 of file idex.c.

Referenced by game_remove_unit(), and texai_unit_destruction_recv().