Freeciv21
Develop your civilization from humble roots to a global empire
disaster.cpp File Reference
#include "fcintl.h"
#include "fc_types.h"
#include "game.h"
#include "name_translation.h"
#include "disaster.h"
+ Include dependency graph for disaster.cpp:

Go to the source code of this file.

Functions

void disaster_types_init ()
 Initialize disaster_type structures. More...
 
void disaster_types_free ()
 Free the memory associated with disaster types. More...
 
Disaster_type_id disaster_number (const struct disaster_type *pdis)
 Return the disaster id. More...
 
Disaster_type_id disaster_index (const struct disaster_type *pdis)
 Return the disaster index. More...
 
struct disaster_typedisaster_by_number (Disaster_type_id id)
 Return disaster type of given id. More...
 
const char * disaster_name_translation (struct disaster_type *pdis)
 Return translated name of this disaster type. More...
 
const char * disaster_rule_name (struct disaster_type *pdis)
 Return untranslated name of this disaster type. More...
 
bool disaster_has_effect (const struct disaster_type *pdis, enum disaster_effect_id effect)
 Check if disaster provides effect. More...
 
bool can_disaster_happen (const struct disaster_type *pdis, const struct city *pcity)
 Whether disaster can happen in given city. More...
 

Variables

static struct disaster_type disaster_types [MAX_DISASTER_TYPES]
 

Function Documentation

◆ can_disaster_happen()

bool can_disaster_happen ( const struct disaster_type pdis,
const struct city pcity 
)

Whether disaster can happen in given city.

Definition at line 108 of file disaster.cpp.

Referenced by check_disasters(), and impr_prevents_disaster().

◆ disaster_by_number()

struct disaster_type* disaster_by_number ( Disaster_type_id  id)

Return disaster type of given id.

Definition at line 72 of file disaster.cpp.

Referenced by handle_ruleset_disaster().

◆ disaster_has_effect()

bool disaster_has_effect ( const struct disaster_type pdis,
enum disaster_effect_id  effect 
)

Check if disaster provides effect.

Definition at line 99 of file disaster.cpp.

Referenced by apply_disaster().

◆ disaster_index()

Disaster_type_id disaster_index ( const struct disaster_type pdis)

Return the disaster index.

Currently same as disaster_number() indicates use as an array index.

Definition at line 62 of file disaster.cpp.

Referenced by load_ruleset_game().

◆ disaster_name_translation()

const char* disaster_name_translation ( struct disaster_type pdis)

Return translated name of this disaster type.

Definition at line 83 of file disaster.cpp.

Referenced by api_methods_disaster_name_translation(), and apply_disaster().

◆ disaster_number()

Disaster_type_id disaster_number ( const struct disaster_type pdis)

Return the disaster id.

Definition at line 49 of file disaster.cpp.

Referenced by send_ruleset_disasters().

◆ disaster_rule_name()

const char* disaster_rule_name ( struct disaster_type pdis)

Return untranslated name of this disaster type.

Definition at line 91 of file disaster.cpp.

Referenced by api_methods_disaster_rule_name(), apply_disaster(), is_universal_needed(), load_ruleset_game(), and sanity_check_ruleset_data().

◆ disaster_types_free()

void disaster_types_free ( )

Free the memory associated with disaster types.

Definition at line 40 of file disaster.cpp.

Referenced by game_ruleset_free().

◆ disaster_types_init()

void disaster_types_init ( )

Initialize disaster_type structures.

Definition at line 27 of file disaster.cpp.

Referenced by game_ruleset_init().

Variable Documentation

◆ disaster_types

struct disaster_type disaster_types[MAX_DISASTER_TYPES]
static

Definition at line 1 of file disaster.cpp.

Referenced by disaster_by_number(), disaster_index(), and disaster_types_init().