Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
agents.h File Reference
#include "support.h"
#include "fc_types.h"

Go to the source code of this file.

Data Structures

struct  agent
 

Macros

#define LAST_AGENT_LEVEL   99
 
#define MAX_AGENT_NAME_LEN   10
 

Enumerations

enum  callback_type { CB_NEW , CB_REMOVE , CB_CHANGE , CB_LAST }
 

Functions

void agents_init (void)
 
void agents_free (void)
 
void register_agent (const struct agent *agent)
 
bool agents_busy (void)
 
void agents_disconnect (void)
 
void agents_processing_started (void)
 
void agents_processing_finished (void)
 
void agents_freeze_hint (void)
 
void agents_thaw_hint (void)
 
void agents_game_joined (void)
 
void agents_game_start (void)
 
void agents_before_new_turn (void)
 
void agents_start_turn (void)
 
void agents_new_turn (void)
 
void agents_unit_changed (struct unit *punit)
 
void agents_unit_new (struct unit *punit)
 
void agents_unit_remove (struct unit *punit)
 
void agents_city_changed (struct city *pcity)
 
void agents_city_new (struct city *pcity)
 
void agents_city_remove (struct city *pcity)
 
void agents_tile_changed (struct tile *ptile)
 
void agents_tile_new (struct tile *ptile)
 
void agents_tile_remove (struct tile *ptile)
 
void cause_a_city_changed_for_agent (const char *name_of_calling_agent, struct city *pcity)
 
void cause_a_unit_changed_for_agent (const char *name_of_calling_agent, struct unit *punit)
 
void wait_for_requests (const char *agent_name, int first_request_id, int last_request_id)
 

Macro Definition Documentation

◆ LAST_AGENT_LEVEL

#define LAST_AGENT_LEVEL   99

Definition at line 32 of file agents.h.

◆ MAX_AGENT_NAME_LEN

#define MAX_AGENT_NAME_LEN   10

Definition at line 34 of file agents.h.

Enumeration Type Documentation

◆ callback_type

Enumerator
CB_NEW 
CB_REMOVE 
CB_CHANGE 
CB_LAST 

Definition at line 36 of file agents.h.

Function Documentation

◆ agents_before_new_turn()

void agents_before_new_turn ( void  )

Called from client/packhand.c.

Definition at line 466 of file agents.c.

Referenced by handle_end_turn().

◆ agents_busy()

bool agents_busy ( void  )

Returns TRUE iff some agent is currently busy.

Definition at line 803 of file agents.c.

Referenced by can_end_turn(), and send_turn_done().

◆ agents_city_changed()

void agents_city_changed ( struct city pcity)

Called from client/packhand.c. See agents_unit_changed() for a generic documentation.

Definition at line 588 of file agents.c.

Referenced by handle_city_info(), and handle_city_short_info().

◆ agents_city_new()

void agents_city_new ( struct city pcity)

Called from client/packhand.c. See agents_unit_changed() for a generic documentation.

Definition at line 614 of file agents.c.

Referenced by handle_city_info(), and handle_city_short_info().

◆ agents_city_remove()

void agents_city_remove ( struct city pcity)

Called from client/packhand.c. See agents_unit_changed() for a generic documentation.

Definition at line 640 of file agents.c.

Referenced by handle_city_remove().

◆ agents_disconnect()

void agents_disconnect ( void  )

Called from client/packhand.c.

Definition at line 404 of file agents.c.

Referenced by set_client_state().

◆ agents_free()

void agents_free ( void  )

Free resources allocated for agents framework

Definition at line 349 of file agents.c.

Referenced by client_game_free(), and client_game_reset().

◆ agents_freeze_hint()

void agents_freeze_hint ( void  )

Called from client/packhand.c.

Definition at line 431 of file agents.c.

Referenced by handle_freeze_client(), and input_from_server().

◆ agents_game_joined()

void agents_game_joined ( void  )

Called from client/packhand.c.

Definition at line 449 of file agents.c.

Referenced by handle_server_join_reply().

◆ agents_game_start()

void agents_game_start ( void  )

Called from client/packhand.c.

Definition at line 457 of file agents.c.

Referenced by set_client_state().

◆ agents_init()

void agents_init ( void  )

Called once per client startup.

Definition at line 335 of file agents.c.

Referenced by client_game_init(), and client_game_reset().

◆ agents_new_turn()

void agents_new_turn ( void  )

Called from client/packhand.c. See agents_unit_changed() for a generic documentation.

Definition at line 483 of file agents.c.

Referenced by handle_new_year().

◆ agents_processing_finished()

void agents_processing_finished ( void  )

Called from client/packhand.c.

Definition at line 422 of file agents.c.

Referenced by handle_processing_finished().

◆ agents_processing_started()

void agents_processing_started ( void  )

Called from client/packhand.c.

Definition at line 413 of file agents.c.

Referenced by handle_processing_started().

◆ agents_start_turn()

void agents_start_turn ( void  )

Called from client/packhand.c.

Definition at line 474 of file agents.c.

Referenced by handle_start_phase().

◆ agents_thaw_hint()

void agents_thaw_hint ( void  )

Called from client/packhand.c.

Definition at line 440 of file agents.c.

Referenced by handle_thaw_client(), and input_from_server().

◆ agents_tile_changed()

void agents_tile_changed ( struct tile ptile)

Called from client/packhand.c. See agents_unit_changed() for a generic documentation.

Definition at line 691 of file agents.c.

Referenced by handle_tile_info().

◆ agents_tile_new()

void agents_tile_new ( struct tile ptile)

Called from client/packhand.c. See agents_unit_changed() for a generic documentation.

Definition at line 715 of file agents.c.

Referenced by handle_tile_info().

◆ agents_tile_remove()

void agents_tile_remove ( struct tile ptile)

Called from client/packhand.c. See agents_unit_changed() for a generic documentation. Tiles got removed because of FOW.

Definition at line 667 of file agents.c.

Referenced by handle_tile_info().

◆ agents_unit_changed()

void agents_unit_changed ( struct unit punit)

Called from client/packhand.c. A call is created and added to the list of outstanding calls if an agent wants to be informed about this event and the change wasn't caused by the agent. We then try (this may not be successful in every case since we can be frozen or another call_handle_methods may be running higher up on the stack) to execute all outstanding calls.

Definition at line 511 of file agents.c.

Referenced by handle_unit_packet_common().

◆ agents_unit_new()

void agents_unit_new ( struct unit punit)

Called from client/packhand.c. See agents_unit_changed() for a generic documentation.

Definition at line 536 of file agents.c.

Referenced by handle_unit_packet_common().

◆ agents_unit_remove()

void agents_unit_remove ( struct unit punit)

Called from client/packhand.c. See agents_unit_changed() for a generic documentation.

Definition at line 562 of file agents.c.

Referenced by handle_unit_remove().

◆ cause_a_city_changed_for_agent()

void cause_a_city_changed_for_agent ( const char name_of_calling_agent,
struct city pcity 
)

Adds a specific call for the given agent.

Definition at line 790 of file agents.c.

Referenced by cma_put_city_under_agent().

◆ cause_a_unit_changed_for_agent()

void cause_a_unit_changed_for_agent ( const char name_of_calling_agent,
struct unit punit 
)

Adds a specific call for the given agent.

Definition at line 777 of file agents.c.

◆ register_agent()

void register_agent ( const struct agent agent)

Registers an agent.

Definition at line 381 of file agents.c.

Referenced by cma_init(), cmafec_init(), and simple_historian_init().

◆ wait_for_requests()

void wait_for_requests ( const char agent_name,
int  first_request_id,
int  last_request_id 
)

Called from an agent. This function will return until the last request has been processed by the server.

Definition at line 739 of file agents.c.

Referenced by apply_result_on_server().