Freeciv-3.2: /fast/freeciv/nightly/S3_2/common/base.c File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Functions
base.c File Reference
`#include "extras.h"`
`#include "game.h"`
`#include "map.h"`
`#include "tile.h"`
`#include "unit.h"`
`#include "base.h"`

Go to the source code of this file.

## Functions

bool | player_can_build_base (const struct base_type *pbase, const struct player *pplayer, const struct tile *ptile)
bool | can_build_base (const struct unit *punit, const struct base_type *pbase, const struct tile *ptile)
struct base_type * | base_by_number (const Base_type_id id)
Base_type_id | base_number (const struct base_type *pbase)
struct extra_type * | base_extra_get (const struct base_type *pbase)
Base_type_id | base_count (void)
void | base_type_init (struct extra_type *pextra, int idx)
void | base_types_free (void)
struct base_type * | get_base_by_gui_type (enum base_gui_type type, const struct unit *punit, const struct tile *ptile)
bool | territory_claiming_base (const struct base_type *pbase)

## Function Documentation

## ◆ base_by_number()

struct base_type * base_by_number | ( | const Base_type_id | id | ) |

Returns base_type entry for an ID value.

Definition at line 76 of file base.c.

Referenced by handle_ruleset_base(), set_unit_activity_base(), and sg_load_player_unit().

## ◆ base_count()

Base_type_id base_count | ( | void |  | ) |

Return the number of base_types.

Definition at line 109 of file base.c.

Referenced by editor_tool_is_usable(), extviewer_view_cell_toggled(), and tab_misc::refresh_stats().

## ◆ base_extra_get()

struct extra_type * base_extra_get | ( | const struct base_type * | pbase | ) |

Return extra that base is.

Definition at line 101 of file base.c.

Referenced by can_build_base(), handle_ruleset_base(), handle_unit_change_activity(), key_unit_airbase(), key_unit_fortress(), player_can_build_base(), real_menus_update(), set_unit_activity_base(), sg_bases_set_bv(), sg_bases_set_dbv(), sg_load_player_unit(), and tile_has_base().

## ◆ base_number()

Base_type_id base_number | ( | const struct base_type * | pbase | ) |

Return the base index.

Definition at line 92 of file base.c.

Referenced by extviewer_refresh_widgets(), load_ruleset_terrain(), objbind_get_value_from_object(), objbind_pack_modified_value(), propval_as_string(), send_ruleset_bases(), and sg_load_player_unit().

## ◆ base_type_init()

void base_type_init | ( | struct extra_type * | pextra,
|  | int | idx
| ) |  |

Initialize base_type structures.

Definition at line 117 of file base.c.

Referenced by handle_ruleset_extra(), and load_terrain_names().

## ◆ base_types_free()

void base_types_free | ( | void |  | ) |

Free the memory associated with base types

Definition at line 132 of file base.c.

Referenced by extras_free().

## ◆ can_build_base()

bool can_build_base | ( | const struct unit * | punit,
|  | const struct base_type * | pbase,
|  | const struct tile * | ptile
| ) |  |

Can unit build base to given tile?

Definition at line 53 of file base.c.

Referenced by actres_possible(), and get_base_by_gui_type().

## ◆ get_base_by_gui_type()

struct base_type * get_base_by_gui_type | ( | enum base_gui_type | type,
|  | const struct unit * | punit,
|  | const struct tile * | ptile
| ) |  |

Get best gui_type base for given parameters

Definition at line 139 of file base.c.

Referenced by can_units_do_base_gui(), handle_unit_change_activity(), key_unit_airbase(), key_unit_fortress(), real_menus_update(), and sg_load_player_unit().

## ◆ player_can_build_base()

bool player_can_build_base | ( | const struct base_type * | pbase,
|  | const struct player * | pplayer,
|  | const struct tile * | ptile
| ) |  |

Tells if player can build base to tile with suitable unit.

Definition at line 30 of file base.c.

## ◆ territory_claiming_base()

bool territory_claiming_base | ( | const struct base_type * | pbase | ) |

Does this base type claim territory?

Definition at line 158 of file base.c.

Referenced by action_actor_utype_hard_reqs_ok_full(), destroy_extra(), handle_ruleset_base(), helptext_extra(), helptext_unit(), load_ruleset_terrain(), map_claim_base(), and tile_has_claimable_base().