Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
base.h File Reference
#include "bitvector.h"
#include "fc_types.h"
#include "requirements.h"
#include "specenum_gen.h"

Go to the source code of this file.

Data Structures

struct  base_type
 

Macros

#define SPECENUM_NAME   base_gui_type
 
#define SPECENUM_VALUE0   BASE_GUI_FORTRESS
 
#define SPECENUM_VALUE0NAME   "Fortress"
 
#define SPECENUM_VALUE1   BASE_GUI_AIRBASE
 
#define SPECENUM_VALUE1NAME   "Airbase"
 
#define SPECENUM_VALUE2   BASE_GUI_OTHER
 
#define SPECENUM_VALUE2NAME   "Other"
 
#define BASE_NONE   -1
 

Functions

Base_type_id base_count (void)
 
Base_type_id base_number (const struct base_type *pbase)
 
struct base_typebase_by_number (const Base_type_id id)
 
struct extra_typebase_extra_get (const struct base_type *pbase)
 
bool can_build_base (const struct unit *punit, const struct base_type *pbase, const struct tile *ptile)
 
bool player_can_build_base (const struct base_type *pbase, const struct player *pplayer, const struct tile *ptile)
 
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)
 
void base_type_init (struct extra_type *pextra, int idx)
 
void base_types_free (void)
 

Macro Definition Documentation

◆ BASE_NONE

#define BASE_NONE   -1

Definition at line 52 of file base.h.

◆ SPECENUM_NAME

Definition at line 30 of file base.h.

◆ SPECENUM_VALUE0

#define SPECENUM_VALUE0   BASE_GUI_FORTRESS

Definition at line 31 of file base.h.

◆ SPECENUM_VALUE0NAME

#define SPECENUM_VALUE0NAME   "Fortress"

Definition at line 32 of file base.h.

◆ SPECENUM_VALUE1

#define SPECENUM_VALUE1   BASE_GUI_AIRBASE

Definition at line 33 of file base.h.

◆ SPECENUM_VALUE1NAME

#define SPECENUM_VALUE1NAME   "Airbase"

Definition at line 34 of file base.h.

◆ SPECENUM_VALUE2

#define SPECENUM_VALUE2   BASE_GUI_OTHER

Definition at line 35 of file base.h.

◆ SPECENUM_VALUE2NAME

#define SPECENUM_VALUE2NAME   "Other"

Definition at line 36 of file base.h.

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)