Feature #40 ยป 0038-Update-code-comments-to-Autosettlers-rename-as-Autow.patch
ai/default/daidata.c | ||
---|---|---|
ai->settler = NULL;
|
||
/* Initialise autosettler. */
|
||
/* Initialise autoworker. */
|
||
dai_auto_settler_init(ai);
|
||
}
|
||
... | ... | |
* open/finish cycle */
|
||
dai_data_phase_finished(ait, pplayer);
|
||
/* Free autosettler. */
|
||
/* Free autoworker. */
|
||
dai_auto_settler_free(ai);
|
||
if (ai->diplomacy.player_intel_slots != NULL) {
|
ai/default/daisettler.c | ||
---|---|---|
/*************************************************************************//**
|
||
Return want for city settler. Note that we rely here on the fact that
|
||
citymap_turn_init() has been run while doing autosettlers.
|
||
citymap_turn_init() has been run while doing autoworkers.
|
||
*****************************************************************************/
|
||
void contemplate_new_city(struct ai_type *ait, struct city *pcity)
|
||
{
|
ai/difficulty.c | ||
---|---|---|
/**********************************************************************//**
|
||
Return the value normal_decision (a boolean), except if the AI is fuzzy,
|
||
then sometimes flip the value. The intention of this is that instead of
|
||
then sometimes flip the value. The intention of this is that instead of
|
||
if (condition) { action }
|
||
you can use
|
||
if (ai_fuzzy(pplayer, condition)) { action }
|
||
... | ... | |
indecisiveness, forgetfulness etc. In practice its often safer to use
|
||
if (condition && ai_fuzzy(pplayer, TRUE)) { action }
|
||
for an action which only makes sense if condition holds, but which a
|
||
fuzzy AI can safely "forget". Note that for a non-fuzzy AI, or for a
|
||
human player being helped by the AI (eg, autosettlers), you can ignore
|
||
fuzzy AI can safely "forget". Note that for a non-fuzzy AI, or for a
|
||
human player being helped by the AI (eg, autoworkers), you can ignore
|
||
the "ai_fuzzy(pplayer," part, and read the previous example as:
|
||
if (condition && TRUE) { action }
|
||
--dwp
|
common/ai.h | ||
---|---|---|
void (*unit_load)(const struct section_file *file, struct unit *punit,
|
||
const char *unitstr);
|
||
/* Called for player AI type when autosettlers have been handled for the turn. */
|
||
/* Called for player AI type when autoworkers have been handled for the turn. */
|
||
void (*settler_reset)(struct player *pplayer);
|
||
/* Called for player AI type when autosettlers should find new work. */
|
||
/* Called for player AI type when autoworkers should find new work. */
|
||
void (*settler_run)(struct player *pplayer, struct unit *punit,
|
||
struct workermap *state);
|
||
/* Called for player AI type for each autosettler still working.
|
||
/* Called for player AI type for each autoworker still working.
|
||
Cancelling current work there will result in settler_run() call. */
|
||
void (*settler_cont)(struct player *pplayer, struct unit *punit,
|
||
struct workermap *state);
|
common/capstr.c | ||
---|---|---|
*
|
||
* The capability string is a string clients and servers trade to find
|
||
* out if they can talk to each other, and using which protocol version,
|
||
* and which features and behaviors to expect. The string is a list of
|
||
* and which features and behaviors to expect. The string is a list of
|
||
* words, separated by whitespace and/or commas, where each word indicates
|
||
* a capability that this version of Freeciv understands.
|
||
* If a capability word is mandatory, it should start with a "+".
|
||
*
|
||
* eg, #define CAPABILITY "+1.6, MapScroll, +AutoSettlers"
|
||
* eg, #define CAPABILITY "+1.6, MapScroll, +AutoWorkers"
|
||
*
|
||
* Client and server functions can test these strings for a particular
|
||
* capability by calling the functions in capability.c
|
||
*
|
||
* Each executable has a string our_capability (above), which gives the
|
||
* capabilities of the running executable. This is normally initialised
|
||
* capabilities of the running executable. This is normally initialised
|
||
* with CAPABILITY, but can be changed at run-time by setting the
|
||
* FREECIV_CAPS environment variable, though that is probably mainly
|
||
* useful for testing purposes.
|
common/city.h | ||
---|---|---|
NB: This doesn't simply check whether pcity->tile == ptile because that
|
||
would miss virtual clones made of city center tiles, which are used by
|
||
autosettler to judge whether improvements are worthwhile. The upshot is
|
||
autoworker to judge whether improvements are worthwhile. The upshot is
|
||
that city centers would appear to lose their irrigation/farmland bonuses
|
||
as well as their minimum outputs of one food and one shield, and thus
|
||
autosettler would rarely transform or mine them.
|
||
autoworker would rarely transform or mine them.
|
||
**************************************************************************/
|
||
static inline bool is_city_center(const struct city *pcity,
|
||
const struct tile *ptile)
|