Freeciv21
Develop your civilization from humble roots to a global empire
unithand.h
Go to the documentation of this file.
1 /*__ ___ ***************************************
2 / \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3 \_ \ / __/ contributors. This file is part of Freeciv21.
4  _\ \ / /__ Freeciv21 is free software: you can redistribute it
5  \___ \____/ __/ and/or modify it under the terms of the GNU General
6  \_ _/ Public License as published by the Free Software
7  | @ @ \_ Foundation, either version 3 of the License,
8  | or (at your option) any later version.
9  _/ /\ You should have received a copy of the GNU
10  /o) (o/\ \_ General Public License along with Freeciv21.
11  \_____/ / If not, see https://www.gnu.org/licenses/.
12  \____/ ********************************************************/
13 #pragma once
14 
15 // common
16 #include "explanation.h"
17 #include "unit.h"
18 
19 #include "hand_gen.h"
20 
21 bool unit_activity_handling(struct unit *punit,
22  enum unit_activity new_activity);
23 bool unit_activity_handling_targeted(struct unit *punit,
24  enum unit_activity new_activity,
25  struct extra_type **new_target);
26 void unit_change_homecity_handling(struct unit *punit,
27  struct city *new_pcity, bool rehome);
28 
29 bool unit_move_handling(struct unit *punit, struct tile *pdesttile,
30  bool igzoc, bool move_diplomat_city);
31 
32 void unit_do_action(struct player *pplayer, const int actor_id,
33  const int target_id, const int sub_tgt_id,
34  const char *name, const action_id action_type);
35 
36 bool unit_perform_action(struct player *pplayer, const int actor_id,
37  const int target_id, const int sub_tgt_id,
38  const char *name, const action_id action_type,
39  const enum action_requester requester);
40 
41 void illegal_action_msg(struct player *pplayer, const enum event_type event,
42  struct unit *actor, const action_id stopped_action,
43  const struct tile *target_tile,
44  const struct city *target_city,
45  const struct unit *target_unit);
46 
47 enum ane_kind action_not_enabled_reason(struct unit *punit, action_id act_id,
48  const struct tile *target_tile,
49  const struct city *target_city,
50  const struct unit *target_unit);
51 
52 bool unit_server_side_agent_set(struct player *pplayer, struct unit *punit,
53  enum server_side_agent agent);
enum event_type event
Definition: events.cpp:68
ane_kind
Definition: explanation.h:15
int action_id
Definition: fc_types.h:306
const char * name
Definition: inputfile.cpp:118
Definition: city.h:291
Definition: player.h:231
Definition: tile.h:42
Definition: unit.h:134
void illegal_action_msg(struct player *pplayer, const enum event_type event, struct unit *actor, const action_id stopped_action, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit)
Try to explain to the player why an action is illegal.
Definition: unithand.cpp:2003
bool unit_activity_handling(struct unit *punit, enum unit_activity new_activity)
Handle request for changing activity.
Definition: unithand.cpp:5485
void unit_do_action(struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id, const char *name, const action_id action_type)
Handle unit action.
Definition: unithand.cpp:2718
void unit_change_homecity_handling(struct unit *punit, struct city *new_pcity, bool rehome)
Transfer a unit from one city (and possibly player) to another.
Definition: unithand.cpp:3239
bool unit_activity_handling_targeted(struct unit *punit, enum unit_activity new_activity, struct extra_type **new_target)
Handle request for targeted activity.
Definition: unithand.cpp:5551
bool unit_move_handling(struct unit *punit, struct tile *pdesttile, bool igzoc, bool move_diplomat_city)
Will try to move to/attack the tile dest_x,dest_y.
Definition: unithand.cpp:4654
bool unit_server_side_agent_set(struct player *pplayer, struct unit *punit, enum server_side_agent agent)
Change controlling server side agent.
Definition: unithand.cpp:5386
enum ane_kind action_not_enabled_reason(struct unit *punit, action_id act_id, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit)
Give the reason kind why an action isn't enabled.
Definition: unithand.cpp:1454
bool unit_perform_action(struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id, const char *name, const action_id action_type, const enum action_requester requester)
Execute a request to perform an action and let the caller know if it was performed or not.
Definition: unithand.cpp:2737