![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "registry.h"#include "achievements.h"#include "game.h"#include "government.h"#include "map.h"#include "movement.h"#include "multipliers.h"#include "nation.h"#include "rgbcolor.h"#include "specialist.h"#include "style.h"#include "unittype.h"#include "version.h"#include "ruleset.h"#include "settings.h"#include "comments.h"#include "rulesave.h"
Include dependency graph for rulesave.cpp:Go to the source code of this file.
Classes | |
| struct | effect_cb_data |
| Effect saving callback data structure. More... | |
Macros | |
| #define | FORMAT_VERSION 20 |
Functions | |
| static struct section_file * | create_ruleset_file (const char *rsname, const char *rstype) |
| Create new ruleset section file with common header. More... | |
| static bool | save_default_int (struct section_file *sfile, int value, int default_value, const char *path, const char *entry) |
| Save int value that has default applied upon loading. More... | |
| static bool | save_default_bool (struct section_file *sfile, bool value, bool default_value, const char *path, const char *entry) |
| Save bool value that has default applied upon loading. More... | |
| static bool | save_name_translation (struct section_file *sfile, struct name_translation *name, const char *path) |
| Save name of the object. More... | |
| static bool | save_reqs_vector (struct section_file *sfile, const struct requirement_vector *reqs, const char *path, const char *entry) |
| Save vector of requirements. More... | |
| static bool | save_tech_list (struct section_file *sfile, int *input, const char *path, const char *entry) |
| Save techs vector. More... | |
| static bool | save_tech_ref (struct section_file *sfile, const struct advance *padv, const char *path, const char *entry) |
| Save tech reference. More... | |
| static bool | save_terrain_ref (struct section_file *sfile, const struct terrain *save, const struct terrain *pthis, const char *path, const char *entry) |
| Save terrain reference. More... | |
| static bool | save_gov_ref (struct section_file *sfile, const struct government *gov, const char *path, const char *entry) |
| Save government reference. More... | |
| static bool | save_building_list (struct section_file *sfile, int *input, const char *path, const char *entry) |
| Save buildings vector. More... | |
| static bool | save_unit_list (struct section_file *sfile, const std::array< unit_type *, MAX_NUM_UNIT_LIST > &input, const char *path, const char *entry) |
| Save units vector. More... | |
| static bool | save_uclass_vec (struct section_file *sfile, bv_unit_classes *bits, const char *path, const char *entry, bool unreachable_only) |
| Save vector of unit class names based on bitvector bits. More... | |
| static bool | save_strvec (struct section_file *sfile, QVector< QString > *to_save, const char *path, const char *entry) |
| Save strvec as ruleset vector of strings. More... | |
| static bool | save_ruleset_file (struct section_file *sfile, const char *filename) |
| Save ruleset file. More... | |
| static bool | save_buildings_ruleset (const char *filename, const char *name) |
| Save buildings.ruleset. More... | |
| static bool | save_styles_ruleset (const char *filename, const char *name) |
| Save styles.ruleset. More... | |
| static bool | save_action_auto_uflag_block (struct section_file *sfile, const int aap, const char *uflags_path, bool(*unexpected_req)(const struct requirement *preq)) |
| Save an action auto performer's !present utype reqs as a regular setting. More... | |
| static bool | save_action_auto_actions (struct section_file *sfile, const int aap, const char *actions_path) |
| Save an action auto performer's action list as a regular setting. More... | |
| static bool | unexpected_non_otype (const struct requirement *req) |
| Missing unit upkeep should only contain output type and absence of blocking unit type flag requirements. More... | |
| static bool | save_muuk_action_auto (struct section_file *sfile, const int aap, const char *item) |
| Save the action a unit should perform when its missing food, gold or shield upkeep. More... | |
| static bool | save_cities_ruleset (const char *filename, const char *name) |
| Save cities.ruleset. More... | |
| static bool | effect_save (struct effect *peffect, void *data) |
| Save one effect. More... | |
| static bool | save_effects_ruleset (const char *filename, const char *name) |
| Save effects.ruleset. More... | |
| static bool | save_action_ui_name (struct section_file *sfile, int act, const char *entry_name) |
| Save ui_name of one action. More... | |
| static bool | save_action_max_range (struct section_file *sfile, action_id act) |
| Save max range of an action. More... | |
| static bool | save_action_range (struct section_file *sfile, action_id act) |
| Save range of an action. More... | |
| static bool | save_action_kind (struct section_file *sfile, action_id act) |
| Save details of an action. More... | |
| static bool | save_action_actor_consuming_always (struct section_file *sfile, action_id act) |
| Save if an action always will consume the actor. More... | |
| static bool | save_game_ruleset (const char *filename, const char *name) |
| Save game.ruleset. More... | |
| static bool | save_governments_ruleset (const char *filename, const char *name) |
| Save governments.ruleset. More... | |
| static bool | save_traits (struct trait_limits *traits, struct trait_limits *default_traits, struct section_file *sfile, const char *secname, const char *field_prefix) |
| Save list of AI traits. More... | |
| static bool | save_nation (struct section_file *sfile, struct nation_type *pnat, int sect_idx) |
| Save a single nation. More... | |
| static bool | save_nations_ruleset (const char *filename, const char *name, struct rule_data *data) |
| Save nations.ruleset. More... | |
| static bool | save_techs_ruleset (const char *filename, const char *name) |
| Save techs.ruleset. More... | |
| static bool | save_terrain_ruleset (const char *filename, const char *name) |
| Save terrain.ruleset. More... | |
| static bool | save_veteran_system (struct section_file *sfile, const char *path, struct veteran_system *vsystem) |
| Save one veteran system. More... | |
| static bool | save_combat_bonuses (struct section_file *sfile, struct unit_type *put, char *path) |
| Save unit combat bonuses list. More... | |
| static bool | save_units_ruleset (const char *filename, const char *name) |
| Save units.ruleset. More... | |
| static bool | save_script_lua (const char *filename, const char *name, const char *buffer) |
| Save script.lua. More... | |
| static bool | save_luadata (const char *filename) |
| Save luadata.txt. More... | |
| bool | save_ruleset (const char *path, const char *name, struct rule_data *data) |
| Save ruleset to directory given. More... | |
| #define FORMAT_VERSION 20 |
Definition at line 46 of file rulesave.cpp.
|
static |
Create new ruleset section file with common header.
Definition at line 51 of file rulesave.cpp.
Referenced by save_buildings_ruleset(), save_cities_ruleset(), save_effects_ruleset(), save_game_ruleset(), save_governments_ruleset(), save_nations_ruleset(), save_styles_ruleset(), save_techs_ruleset(), save_terrain_ruleset(), and save_units_ruleset().
|
static |
Save one effect.
Callback called for each effect in cache.
Definition at line 738 of file rulesave.cpp.
Referenced by save_effects_ruleset().
|
static |
Save if an action always will consume the actor.
Definition at line 856 of file rulesave.cpp.
Referenced by save_game_ruleset().
|
static |
Save an action auto performer's action list as a regular setting.
This is done because the Action Auto Perform rules system isn't ready to be exposed to the ruleset yet. The setting is a list of actions in the order they should be tried.
Definition at line 556 of file rulesave.cpp.
Referenced by save_game_ruleset(), and save_muuk_action_auto().
|
static |
Save an action auto performer's !present utype reqs as a regular setting.
This is done because the Action Auto Perform rules system isn't ready to be exposed to the ruleset yet. The setting is a list of utype flags that prevents the auto action performer.
Definition at line 510 of file rulesave.cpp.
Referenced by save_muuk_action_auto().
|
static |
Save details of an action.
Definition at line 834 of file rulesave.cpp.
Referenced by save_game_ruleset().
|
static |
Save max range of an action.
Definition at line 796 of file rulesave.cpp.
Referenced by save_action_range().
|
static |
Save range of an action.
Definition at line 812 of file rulesave.cpp.
Referenced by save_game_ruleset().
|
static |
Save ui_name of one action.
Definition at line 781 of file rulesave.cpp.
Referenced by save_game_ruleset().
|
static |
Save buildings vector.
Input is B_LAST terminated array of buildings to save.
Definition at line 262 of file rulesave.cpp.
Referenced by save_game_ruleset(), and save_nation().
|
static |
|
static |
|
static |
Save unit combat bonuses list.
Definition at line 2657 of file rulesave.cpp.
Referenced by save_units_ruleset().
|
static |
Save bool value that has default applied upon loading.
Definition at line 95 of file rulesave.cpp.
Referenced by save_action_actor_consuming_always(), and save_game_ruleset().
|
static |
Save int value that has default applied upon loading.
Definition at line 77 of file rulesave.cpp.
Referenced by save_action_max_range(), save_action_range(), and save_game_ruleset().
|
static |
|
static |
|
static |
Save government reference.
Definition at line 249 of file rulesave.cpp.
Referenced by save_governments_ruleset().
|
static |
Save governments.ruleset.
Definition at line 1469 of file rulesave.cpp.
Referenced by save_ruleset().
|
static |
|
static |
Save the action a unit should perform when its missing food, gold or shield upkeep.
Save as regular settings since the Action Auto Perform rules system isn't ready to be exposed to the ruleset yet.
Definition at line 597 of file rulesave.cpp.
Referenced by save_cities_ruleset().
|
static |
Save name of the object.
Definition at line 113 of file rulesave.cpp.
Referenced by save_buildings_ruleset(), save_cities_ruleset(), save_game_ruleset(), save_governments_ruleset(), save_nation(), save_nations_ruleset(), save_styles_ruleset(), save_techs_ruleset(), save_terrain_ruleset(), and save_units_ruleset().
|
static |
Save a single nation.
Definition at line 1594 of file rulesave.cpp.
Referenced by save_nations_ruleset().
|
static |
|
static |
Save vector of requirements.
Definition at line 133 of file rulesave.cpp.
Referenced by effect_save(), save_buildings_ruleset(), save_cities_ruleset(), save_game_ruleset(), save_governments_ruleset(), save_styles_ruleset(), save_techs_ruleset(), and save_terrain_ruleset().
| bool save_ruleset | ( | const char * | path, |
| const char * | name, | ||
| struct rule_data * | data | ||
| ) |
Save ruleset to directory given.
Definition at line 3013 of file rulesave.cpp.
Referenced by main(), and tab_misc::save_now().
|
static |
Save ruleset file.
Definition at line 356 of file rulesave.cpp.
Referenced by save_buildings_ruleset(), save_cities_ruleset(), save_effects_ruleset(), save_game_ruleset(), save_governments_ruleset(), save_nations_ruleset(), save_styles_ruleset(), save_techs_ruleset(), save_terrain_ruleset(), and save_units_ruleset().
|
static |
|
static |
Save strvec as ruleset vector of strings.
Definition at line 341 of file rulesave.cpp.
Referenced by save_buildings_ruleset(), save_cities_ruleset(), save_game_ruleset(), save_governments_ruleset(), save_techs_ruleset(), save_terrain_ruleset(), and save_units_ruleset().
|
static |
|
static |
Save techs vector.
Input is A_LAST terminated array of techs to save.
Definition at line 191 of file rulesave.cpp.
Referenced by save_game_ruleset(), and save_nation().
|
static |
Save tech reference.
Definition at line 214 of file rulesave.cpp.
Referenced by save_techs_ruleset(), and save_units_ruleset().
|
static |
|
static |
Save terrain reference.
Definition at line 230 of file rulesave.cpp.
Referenced by save_terrain_ruleset().
|
static |
|
static |
Save list of AI traits.
Definition at line 1552 of file rulesave.cpp.
Referenced by save_nation(), and save_nations_ruleset().
|
static |
Save vector of unit class names based on bitvector bits.
Definition at line 314 of file rulesave.cpp.
Referenced by save_units_ruleset().
|
static |
Save units vector.
Input is nullptr terminated array of units to save.
Definition at line 288 of file rulesave.cpp.
Referenced by save_nation().
|
static |
|
static |
Save one veteran system.
Definition at line 2622 of file rulesave.cpp.
Referenced by save_units_ruleset().
|
static |
Missing unit upkeep should only contain output type and absence of blocking unit type flag requirements.
Definition at line 587 of file rulesave.cpp.
Referenced by save_muuk_action_auto().