Freeciv-3.1: /fast/freeciv/nightly/S3_1/server/advisors/advchoice.c File Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Functions
advchoice.c File Reference
`#include "support.h"`
`#include "improvement.h"`
`#include "requirements.h"`
`#include "unittype.h"`
`#include "advchoice.h"`

Go to the source code of this file.

## Functions

void | adv_init_choice (struct adv_choice *choice)
void | adv_deinit_choice (struct adv_choice *choice)
struct adv_choice * | adv_new_choice (void)
void | adv_free_choice (struct adv_choice *choice)
struct adv_choice * | adv_better_choice (struct adv_choice *first, struct adv_choice *second)
struct adv_choice * | adv_better_choice_free (struct adv_choice *first, struct adv_choice *second)
bool | is_unit_choice_type (enum choice_type type)
const char * | adv_choice_rule_name (const struct adv_choice *choice)

## Function Documentation

## ◆ adv_better_choice()

struct adv_choice * adv_better_choice | ( | struct adv_choice * | first,
|  | struct adv_choice * | second
| ) |  |

Return better one of the choices given. In case of a draw, first one is preferred.

Definition at line 85 of file advchoice.c.

Referenced by dai_city_choose_build().

## ◆ adv_better_choice_free()

struct adv_choice * adv_better_choice_free | ( | struct adv_choice * | first,
|  | struct adv_choice * | second
| ) |  |

Return better one of the choices given, and free the other.

Definition at line 98 of file advchoice.c.

Referenced by domestic_advisor_choose_build().

## ◆ adv_choice_rule_name()

const char * adv_choice_rule_name | ( | const struct adv_choice * | choice | ) |

Return the (untranslated) rule name of the adv_choice. You don't have to free the return pointer.

Definition at line 124 of file advchoice.c.

Referenced by dai_city_choose_build(), dai_spend_gold(), and military_advisor_choose_build().

## ◆ adv_deinit_choice()

void adv_deinit_choice | ( | struct adv_choice * | choice | ) |

Clear choice without freeing it itself

Definition at line 46 of file advchoice.c.

Referenced by dai_city_free(), military_advisor_choose_build(), and texai_city_free().

## ◆ adv_free_choice()

void adv_free_choice | ( | struct adv_choice * | choice | ) |

Free dynamically allocated choice.

Definition at line 71 of file advchoice.c.

Referenced by adv_better_choice_free(), dai_city_choose_build(), dai_manage_cities(), kill_something_with(), and texai_check_messages().

## ◆ adv_init_choice()

void adv_init_choice | ( | struct adv_choice * | choice | ) |

Sets the values of the choice to initial values.

Definition at line 31 of file advchoice.c.

Referenced by adv_new_choice(), dai_city_alloc(), dai_do_build_city(), dai_spend_gold(), military_advisor_choose_build(), and texai_city_alloc().

## ◆ adv_new_choice()

struct adv_choice * adv_new_choice | ( | void |  | ) |

Dynamically allocate a new choice.

Definition at line 59 of file advchoice.c.

Referenced by domestic_advisor_choose_build(), kill_something_with(), and military_advisor_choose_build().

## ◆ is_unit_choice_type()

bool is_unit_choice_type | ( | enum choice_type | type | ) |

Does choice type refer to unit

Definition at line 115 of file advchoice.c.

Referenced by adjust_ai_unit_choice(), and dai_spend_gold().