Freeciv-3.4
Loading...
Searching...
No Matches
daiferry.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2002 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__DAIFERRY_H
14#define FC__DAIFERRY_H
15
16/* utility */
17#include "support.h" /* bool type */
18
19/* common */
20#include "fc_types.h"
21
22struct pf_path;
23struct pft_amphibious;
24
25bool dai_is_ferry_type(const struct unit_type *pferry, struct ai_type *ait);
26bool dai_is_ferry(struct unit *pferry, struct ai_type *ait);
27
28/*
29 * Initialize ferrybaot-related statistics in the ai data.
30 */
31void aiferry_init_stats(struct ai_type *ait, struct player *pplayer);
32
33/*
34 * Find the nearest boat. Can be called from inside the continents too
35 */
36int aiferry_find_boat(struct ai_type *ait, struct unit *punit,
37 int cap, struct pf_path **path);
38
39/*
40 * How many boats are available
41 */
42int aiferry_avail_boats(struct ai_type *ait, struct player *pplayer);
43
44/*
45 * Initializes aiferry stats for a new unit
46 */
47void dai_ferry_init_ferry(struct ai_type *ait, struct unit *ferry);
48void dai_ferry_lost(struct ai_type *ait, struct unit *punit);
49void dai_ferry_transformed(struct ai_type *ait, struct unit *ferry,
50 const struct unit_type *old);
51
52/*
53 * Release the boat reserved in punit's ai.ferryboat field.
54 */
55void aiferry_clear_boat(struct ai_type *ait, struct unit *punit);
56
57/*
58 * Go to the destination by hitching a ride on a boat. Will try to find
59 * a beachhead but it works better if dst_tile is on the coast.
60 * Loads a bodyguard too, if necessary.
61 */
62bool aiferry_gobyboat(struct ai_type *ait, struct player *pplayer,
63 struct unit *punit, struct tile *dst_tile,
64 bool with_bodyguard);
65/*
66 * Go to the destination on a particular boat. Will try to find
67 * a beachhead but it works better if ptile is on the coast.
68 */
69bool aiferry_goto_amphibious(struct ai_type *ait, struct unit *ferry,
70 struct unit *passenger, struct tile *ptile);
71
73 struct unit *ferry,
74 struct unit *passenger,
75 struct tile *ptile,
76 struct pft_amphibious *parameter);
77
78bool is_boat_free(struct ai_type *ait, struct unit *boat,
79 struct unit *punit, int cap);
80bool is_boss_of_boat(struct ai_type *ait, struct unit *punit);
81
82/*
83 * Main boat managing function. Gets units on board to where they want to
84 * go and then looks for new passengers or (if it fails) for a city which
85 * will build a passenger soon.
86 */
87void dai_manage_ferryboat(struct ai_type *ait, struct player *pplayer,
88 struct unit *punit);
89
90#endif /* FC__DAIFERRY_H */
char * incite_cost
Definition comments.c:76
int aiferry_find_boat(struct ai_type *ait, struct unit *punit, int cap, struct pf_path **path)
Definition daiferry.c:495
void dai_manage_ferryboat(struct ai_type *ait, struct player *pplayer, struct unit *punit)
Definition daiferry.c:1119
bool is_boat_free(struct ai_type *ait, struct unit *boat, struct unit *punit, int cap)
Definition daiferry.c:438
bool dai_is_ferry_type(const struct unit_type *pferry, struct ai_type *ait)
Definition daiferry.c:149
void aiferry_init_stats(struct ai_type *ait, struct player *pplayer)
Definition daiferry.c:92
void dai_ferry_lost(struct ai_type *ait, struct unit *punit)
Definition daiferry.c:221
void dai_ferry_transformed(struct ai_type *ait, struct unit *ferry, const struct unit_type *old)
Definition daiferry.c:189
bool aiferry_goto_amphibious(struct ai_type *ait, struct unit *ferry, struct unit *passenger, struct tile *ptile)
Definition daiferry.c:730
bool is_boss_of_boat(struct ai_type *ait, struct unit *punit)
Definition daiferry.c:471
int aiferry_avail_boats(struct ai_type *ait, struct player *pplayer)
Definition daiferry.c:353
bool dai_amphibious_goto_constrained(struct ai_type *ait, struct unit *ferry, struct unit *passenger, struct tile *ptile, struct pft_amphibious *parameter)
Definition daiferry.c:634
bool dai_is_ferry(struct unit *pferry, struct ai_type *ait)
Definition daiferry.c:159
void dai_ferry_init_ferry(struct ai_type *ait, struct unit *ferry)
Definition daiferry.c:167
void aiferry_clear_boat(struct ai_type *ait, struct unit *punit)
Definition daiferry.c:251
bool aiferry_gobyboat(struct ai_type *ait, struct player *pplayer, struct unit *punit, struct tile *dst_tile, bool with_bodyguard)
Definition daiferry.c:764
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
Definition dialogs_g.h:74
Definition ai.h:50
Definition tile.h:50
Definition unit.h:140