- Swap std::set<flag_id> for cata::flat_set<flag_id>
- Update FlagsSetType in item, itype, and pocket_data
- Replace emplace with insert on tag caches
- Adjust bionics_test cast to std::set<json_character_flag>
... three times, until it stops making new suggestions.
Run with --safe_headers (default) (i.e. headers can only
get new includes added, but can't get anything removed)
The code does not compile in current state (kinda expected),
manual fixups will follow.
--nosafe_headers commit would also follow afterwards
The "simple" files are those that don't have any sort of
define/if defined/ifndef conditional compilation in them.
Just plain old c++ with no preprocessor.
Code size:
includes:
$ cat obj/tiles/*.inc | wc
290436 580872 17972230
$ cat tests/obj/tiles/*.inc | wc
168196 336392 10510740
post-processed (clang -E):
cat ./out/pp/src/* | wc
69365093 179919823 2157445134
cat ./out/pp/tests/* | wc
40499273 106027071 1277878587
The code size increase is expected due to --safe_headers
Add a new event_field_transformation that fetches the overmap_special_id
of the special at particular OMT coordinates.
Use that to tweak the Last Homely House achievement to trigger on entry
into any refugee centre OMT, rather than just the one specific one.
Also, added a type safety check for achievement requirements because I
made that mistake while working on this PR. That check revealed an
issue with the Xedra Evolved achievements, so fixed those.
* Port code to emplace_back
This is clang-tidy making automated changes to convert push_back into
emplace_back whenever the argument to push_back is either a constructor
call for the type in question of an expression of a type implicitly
convertible to the type in question.
This should eliminate one move-construction of the inserted object for
each call.
* Enable clang-tidy modernize-use-emplace
* Change _ctype.h and __locale to cctype and clocale
* Change _wctype.h to cwctype in game.cpp
* Change __functional_base to functional
* Remove libcxx internal headers
* Remove UNIX system headers
* Fix clang-tidy error with -nostdinc++
* change item flag type from std::string to flag_str_id/flag_id in the following entities: item::item_tags, itype::item_tags, Item_modifier::custom_flags, recipe::flags_to_delete, effect_type::flags, harvest_entry::flags, clothing_mod::flag, zone_priority_data::flags, pocket_data::flag_restriction, heal_actor::used_up_item_flags, jmapgen_spawn_item::flags, ma_requirements::req_flags
change item flag type method signatures where needed;
supplementary changes
Previously a value_constraint field could simply specify a string and it
would be compared against the content of the variant. But this is not
very safe. Require the relevant json to also specify the
cata_variant_type of the desired value, facilitating proper
type-checking.
For event_statistic, add a type() method. For event_transformation, add
a fields() method.
Consolidate the type of all these field lookup objects as
std::unordered_map<std::string, cata_variant_type> (previously some
places had used std::map).
* Helper script to run IWYU
* Run IWYU
* Update deprecated headers
* Run IWYU again
* Re-suppress cxxabi.h
This pragma got accidentally removed because it was deemed to be a
comment attached to a #include.
* Remove extra SDL header includes
* Fix ime.cpp headers
Some tweaks to help IWYU not break this file by messing with
platform-specific stuff not relevant on Linux.
* Update game.h
* Move new point.h includes inside #ifdef
* Re-add platform_win.h to mapsharing.cpp
* Apply suggestions from code review
Co-authored-by: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com>
Two new features for event_transformations: the ability to drop fields,
and the ability to add new fields using new event_field_transformation
functions.
The only such function currently implemented is extracting species from
monster types.