Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
counters.h File Reference
#include "support.h"
#include "name_translation.h"

Go to the source code of this file.

Data Structures

struct  counter
 

Macros

#define city_counters_iterate(pcount)
 
#define city_counters_iterate_end
 
#define counters_re_iterate(pcount)
 
#define counters_re_iterate_end
 

Functions

void counters_init (void)
 
void counters_free (void)
 
struct countercounter_by_id (int id)
 
int counter_id (struct counter *pcount)
 
struct countercounter_by_rule_name (const char *name)
 
const charcounter_rule_name (struct counter *pcount)
 
const charcounter_name_translation (const struct counter *counter)
 
struct countercounter_by_translated_name (const char *name)
 
int counter_index (const struct counter *pcount)
 
struct countercounter_by_index (int index, enum counter_target target)
 
int counters_get_city_counters_count (void)
 
void attach_city_counter (struct counter *counter)
 

Macro Definition Documentation

◆ city_counters_iterate

#define city_counters_iterate (   pcount)
Value:
{ \
int _i_##pcount; \
struct counter *pcount; \
char * incite_cost
Definition comments.c:75
struct counter * counter_by_index(int index, enum counter_target target)
Definition counters.c:183
int counters_get_city_counters_count(void)
Definition counters.c:74
@ CTGT_CITY
Definition fc_types.h:126

Definition at line 57 of file counters.h.

◆ city_counters_iterate_end

#define city_counters_iterate_end
Value:
} \
}

Definition at line 64 of file counters.h.

◆ counters_re_iterate

#define counters_re_iterate (   pcount)
Value:
{ \
int _i_##pcount; \
struct counter *pcount; \
struct counter * counter_by_id(int id)
Definition counters.c:82
struct civ_game game
Definition game.c:62
struct packet_ruleset_control control
Definition game.h:83
bool ruledit_disabled
Definition counters.h:30

Definition at line 67 of file counters.h.

◆ counters_re_iterate_end

#define counters_re_iterate_end
Value:
} \
} \
} \
}

Definition at line 75 of file counters.h.

Function Documentation

◆ attach_city_counter()

void attach_city_counter ( struct counter counter)

Attaching given counter type to array containing counter type related to cities. Counter must be present in array for each counter in game, but we do not check this.

Definition at line 94 of file counters.c.

Referenced by tab_counter::add_now(), handle_ruleset_counter(), and load_ruleset_game().

◆ counter_by_id()

struct counter * counter_by_id ( int  id)

◆ counter_by_index()

struct counter * counter_by_index ( int  index,
enum counter_target  target 
)

Return counter by given index

Definition at line 183 of file counters.c.

Referenced by create_city_virtual(), sg_save_counters(), and universal_value_initial().

◆ counter_by_rule_name()

struct counter * counter_by_rule_name ( const char name)

Search for counter by rule name (return matched counter if found or NULL)

Definition at line 115 of file counters.c.

Referenced by api_find_counter_by_name(), tab_counter::select_counter(), sg_load_counters(), and universal_value_from_str().

◆ counter_by_translated_name()

struct counter * counter_by_translated_name ( const char name)

Search for counter by translated name (return matched counter if found or NULL)

Definition at line 136 of file counters.c.

◆ counter_id()

int counter_id ( struct counter pcount)

Return id of a given counter

Definition at line 105 of file counters.c.

Referenced by api_find_counter(), tolua_game_find_counter01(), and universal_number().

◆ counter_index()

int counter_index ( const struct counter pcount)

◆ counter_name_translation()

const char * counter_name_translation ( const struct counter counter)

◆ counter_rule_name()

const char * counter_rule_name ( struct counter pcount)

◆ counters_free()

void counters_free ( void  )

Free resources allocated by counters system

Definition at line 51 of file counters.c.

Referenced by game_ruleset_free().

◆ counters_get_city_counters_count()

int counters_get_city_counters_count ( void  )

◆ counters_init()

void counters_init ( void  )

Initialize counters system

Definition at line 40 of file counters.c.

Referenced by game_ruleset_init().