Freeciv-3.2
Loading...
Searching...
No Matches
Enumerations | Functions
goto.h File Reference

Go to the source code of this file.

Enumerations

enum  goto_tile_state { GTS_TURN_STEP , GTS_MP_LEFT , GTS_EXHAUSTED_MP , GTS_COUNT }
 

Functions

void init_client_goto (void)
 
void free_client_goto (void)
 
void enter_goto_state (struct unit_list *punits)
 
void exit_goto_state (void)
 
void goto_unit_killed (struct unit *punit)
 
bool goto_is_active (void)
 
bool goto_get_turns (int *min, int *max)
 
bool goto_tile_state (const struct tile *ptile, enum goto_tile_state *state, int *turns, bool *waypoint)
 
bool goto_add_waypoint (void)
 
bool goto_pop_waypoint (void)
 
bool is_valid_goto_destination (const struct tile *ptile)
 
bool is_valid_goto_draw_line (struct tile *dest_tile)
 
void request_orders_cleared (struct unit *punit)
 
void send_goto_path (struct unit *punit, struct pf_path *path, struct unit_order *last_order)
 
bool send_goto_tile (struct unit *punit, struct tile *ptile)
 
bool send_rally_tile (struct city *pcity, struct tile *ptile, bool persistent)
 
bool send_attack_tile (struct unit *punit, struct tile *ptile)
 
void send_patrol_route (void)
 
void send_goto_route (void)
 
void send_connect_route (enum unit_activity activity, struct extra_type *tgt)
 
struct pf_pathpath_to_nearest_allied_city (struct unit *punit)
 
struct tiletile_before_end_path (struct unit *punit, struct tile *ptile)
 

Enumeration Type Documentation

◆ goto_tile_state

Enumerator
GTS_TURN_STEP 
GTS_MP_LEFT 
GTS_EXHAUSTED_MP 
GTS_COUNT 

Definition at line 25 of file goto.h.

Function Documentation

◆ enter_goto_state()

void enter_goto_state ( struct unit_list *  punits)

Enter the goto state: activate, prepare PF-template and add the initial part.

Definition at line 1001 of file goto.c.

Referenced by patrol_here_callback(), request_unit_connect(), request_unit_goto(), request_unit_patrol(), and mr_menu::slot_delayed_goto().

◆ exit_goto_state()

void exit_goto_state ( void  )

Tidy up and deactivate goto state.

Definition at line 1022 of file goto.c.

Referenced by paradrop_here_callback(), patrol_here_callback(), set_hover_state(), and map_view::shortcut_pressed().

◆ free_client_goto()

void free_client_goto ( void  )

Called above, and by control_done() in client/control.c.

Definition at line 162 of file goto.c.

Referenced by control_free(), and init_client_goto().

◆ goto_add_waypoint()

bool goto_add_waypoint ( void  )

Inserts a waypoint at the end of the current goto line.

Definition at line 487 of file goto.c.

Referenced by request_unit_connect(), request_unit_goto(), and request_unit_patrol().

◆ goto_get_turns()

bool goto_get_turns ( int min,
int max 
)

Return the path length (in turns). WARNING: not useful for determining paths of scattered groups.

Definition at line 1068 of file goto.c.

Referenced by get_unit_info_label_text2().

◆ goto_is_active()

bool goto_is_active ( void  )

Is goto state active?

Definition at line 1059 of file goto.c.

◆ goto_pop_waypoint()

bool goto_pop_waypoint ( void  )

Returns whether there were any waypoint popped (we don't remove the initial position)

Definition at line 524 of file goto.c.

Referenced by key_cancel_action().

◆ goto_tile_state()

bool goto_tile_state ( const struct tile ptile,
enum goto_tile_state state,
int turns,
bool waypoint 
)

Returns the state of 'ptile': turn number to print, and whether 'ptile' is a waypoint.

Definition at line 1144 of file goto.c.

◆ goto_unit_killed()

void goto_unit_killed ( struct unit punit)

Called from control_unit_killed() in client/control.c

Definition at line 1040 of file goto.c.

Referenced by control_unit_killed().

◆ init_client_goto()

void init_client_goto ( void  )

Called only by handle_map_info() in client/packhand.c.

Definition at line 152 of file goto.c.

Referenced by handle_map_info().

◆ is_valid_goto_destination()

bool is_valid_goto_destination ( const struct tile ptile)

Determines if a goto to the destination tile is allowed.

Definition at line 179 of file goto.c.

Referenced by control_mouse_cursor().

◆ is_valid_goto_draw_line()

bool is_valid_goto_draw_line ( struct tile dest_tile)

Puts a line to dest_tile on the map according to the current goto_map. If there is no route to the dest then don't draw anything.

Definition at line 1338 of file goto.c.

Referenced by do_unit_connect(), do_unit_goto(), do_unit_patrol_to(), overview_update_line(), and update_line().

◆ path_to_nearest_allied_city()

struct pf_path * path_to_nearest_allied_city ( struct unit punit)

Find the path to the nearest (fastest to reach) allied city for the unit, or NULL if none is reachable.

Definition at line 1982 of file goto.c.

Referenced by request_unit_return().

◆ request_orders_cleared()

void request_orders_cleared ( struct unit punit)

Send a packet to the server to request that the current orders be cleared.

Definition at line 1363 of file goto.c.

Referenced by clear_unit_orders().

◆ send_attack_tile()

bool send_attack_tile ( struct unit punit,
struct tile ptile 
)

Send orders for the unit to move it to the arbitrary tile and attack everything it approaches. Returns FALSE if no path is found.

Definition at line 1621 of file goto.c.

Referenced by mr_menu::slot_execute_orders().

◆ send_connect_route()

void send_connect_route ( enum unit_activity  activity,
struct extra_type tgt 
)

Send the current connect route (i.e., the one generated via HOVER_STATE) to the server.

Definition at line 1713 of file goto.c.

Referenced by do_unit_connect().

◆ send_goto_path()

void send_goto_path ( struct unit punit,
struct pf_path path,
struct unit_order final_order 
)

Send an arbitrary goto path for the unit to the server.

Definition at line 1530 of file goto.c.

Referenced by request_unit_return(), send_goto_route(), and send_goto_tile().

◆ send_goto_route()

void send_goto_route ( void  )

Send the current goto route (i.e., the one generated via HOVER_STATE) to the server. The route might involve more than one part, if waypoints were used. FIXME: danger paths are not supported.

Definition at line 1869 of file goto.c.

Referenced by do_unit_goto(), and key_unit_action_select_tgt().

◆ send_goto_tile()

bool send_goto_tile ( struct unit punit,
struct tile ptile 
)

Send orders for the unit to move it to the arbitrary tile. Returns FALSE if no path is found.

Definition at line 1551 of file goto.c.

Referenced by goto_dialog::go_to_city(), goto_city_callback(), goto_cmd_callback(), goto_here_callback(), and mr_menu::slot_autocaravan().

◆ send_patrol_route()

void send_patrol_route ( void  )

Send the current patrol route (i.e., the one generated via HOVER_STATE) to the server.

Definition at line 1647 of file goto.c.

Referenced by do_unit_patrol_to().

◆ send_rally_tile()

bool send_rally_tile ( struct city pcity,
struct tile ptile,
bool  persistent 
)

Send rally orders for the city to move new units to the arbitrary tile. Returns FALSE if no path is found for the currently produced unit type.

Definition at line 1575 of file goto.c.

Referenced by rally_set_tile(), and map_view::shortcut_pressed().

◆ tile_before_end_path()

struct tile * tile_before_end_path ( struct unit punit,
struct tile ptile 
)

Finds penultimate tile on path for given unit going to ptile

Definition at line 2011 of file goto.c.

Referenced by mr_menu::find_last_unit_pos().