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_typebase_by_number (const Base_type_id id)
 
Base_type_id base_number (const struct base_type *pbase)
 
struct extra_typebase_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_typeget_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)

◆ base_number()

Base_type_id base_number ( const struct base_type pbase)

◆ 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)