Freeciv-3.4
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
tiledef.h File Reference
#include "extras.h"

Go to the source code of this file.

Data Structures

struct  tiledef
 

Macros

#define tiledef_index(_td_)   (_td_)->id
 
#define tiledef_iterate(_p)
 
#define tiledef_iterate_end
 

Functions

void tiledefs_init (void)
 
void tiledefs_free (void)
 
int tiledef_count (void)
 
int tiledef_number (const struct tiledef *td)
 
struct tiledeftiledef_by_number (int id)
 
const chartiledef_name_translation (const struct tiledef *td)
 
const chartiledef_rule_name (const struct tiledef *td)
 
struct tiledeftiledef_by_rule_name (const char *name)
 
struct tiledeftiledef_by_translated_name (const char *name)
 
bool tile_matches_tiledef (const struct tiledef *td, const struct tile *ptile) fc__attribute((nonnull(1
 

Macro Definition Documentation

◆ tiledef_index

#define tiledef_index (   _td_)    (_td_)->id

Definition at line 41 of file tiledef.h.

◆ tiledef_iterate

#define tiledef_iterate (   _p)
Value:
{ \
int _i_##_p; \
char * incite_cost
Definition comments.c:76
struct civ_game game
Definition game.c:62
struct packet_ruleset_control control
Definition game.h:83
struct tiledef * tiledef_by_number(int id)
Definition tiledef.c:83

Definition at line 48 of file tiledef.h.

◆ tiledef_iterate_end

#define tiledef_iterate_end
Value:
} \
}

Definition at line 54 of file tiledef.h.

Function Documentation

◆ tile_matches_tiledef()

bool tile_matches_tiledef ( const struct tiledef td,
const struct tile ptile 
)

◆ tiledef_by_number()

struct tiledef * tiledef_by_number ( int  id)

Return tiledef type of given id.

Definition at line 83 of file tiledef.c.

Referenced by handle_ruleset_tiledef(), and load_terrain_names().

◆ tiledef_by_rule_name()

struct tiledef * tiledef_by_rule_name ( const char name)

Returns tiledef matching rule name or nullptr if there is no tiledef with such name.

Definition at line 112 of file tiledef.c.

◆ tiledef_by_translated_name()

struct tiledef * tiledef_by_translated_name ( const char name)

Returns tiledef matching the translated name, or nullptr if there is no tiledef with that name.

Definition at line 135 of file tiledef.c.

◆ tiledef_count()

int tiledef_count ( void  )

Return the number of tiledef_types

Definition at line 53 of file tiledef.c.

◆ tiledef_name_translation()

const char * tiledef_name_translation ( const struct tiledef td)

Return the (translated) name of the tiledef. You don't have to free the return pointer.

Definition at line 94 of file tiledef.c.

Referenced by tiledef_by_translated_name().

◆ tiledef_number()

int tiledef_number ( const struct tiledef td)

Return the tiledef id.

Definition at line 61 of file tiledef.c.

Referenced by send_ruleset_tiledefs().

◆ tiledef_rule_name()

const char * tiledef_rule_name ( const struct tiledef td)

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

Definition at line 103 of file tiledef.c.

Referenced by tiledef_by_rule_name().

◆ tiledefs_free()

void tiledefs_free ( void  )

Free the memory associated with tiledef

Definition at line 41 of file tiledef.c.

Referenced by game_ruleset_free().

◆ tiledefs_init()

void tiledefs_init ( void  )

Initialize tiledef structures.

Definition at line 28 of file tiledef.c.

Referenced by game_ruleset_init().