Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: extract to vehicle_part.h #3104

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "ui.h"
#include "ui_manager.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const quality_id qual_BUTCHER( "BUTCHER" );
Expand Down
1 change: 1 addition & 0 deletions src/active_tile_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "mapbuffer.h"
#include "rng.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_range.h"
#include "weather.h"

Expand Down
1 change: 1 addition & 0 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "uistate.h"
#include "units.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const itype_id itype_bone_human( "bone_human" );
Expand Down
1 change: 1 addition & 0 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
#include "value_ptr.h"
#include "veh_interact.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const activity_id ACT_ADV_INVENTORY( "ACT_ADV_INVENTORY" );
Expand Down
1 change: 1 addition & 0 deletions src/activity_item_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "value_ptr.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_selector.h"
#include "vpart_position.h"
#include "weather.h"
Expand Down
1 change: 1 addition & 0 deletions src/advanced_inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "units.h"
#include "units_utility.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_selector.h"

#if defined(__ANDROID__)
Expand Down
1 change: 1 addition & 0 deletions src/advanced_inv_area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "uistate.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

int advanced_inv_area::get_item_count() const
Expand Down
1 change: 1 addition & 0 deletions src/advanced_inv_pane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "uistate.h"
#include "units.h"
#include "vehicle.h"
#include "vehicle_part.h"

#if defined(__ANDROID__)
# include <SDL_keyboard.h>
Expand Down
1 change: 1 addition & 0 deletions src/avatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#include "ui.h"
#include "value_ptr.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const activity_id ACT_READ( "ACT_READ" );
Expand Down
1 change: 1 addition & 0 deletions src/avatar_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include "value_ptr.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

class player;
Expand Down
1 change: 1 addition & 0 deletions src/avatar_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "trap.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const trait_id trait_CHLOROMORPH( "CHLOROMORPH" );
Expand Down
1 change: 1 addition & 0 deletions src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#include "units_utility.h"
#include "value_ptr.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "weather.h"
#include "weather_gen.h"
Expand Down Expand Up @@ -496,7 +497,7 @@
return cbm_list;
}

const std::map<item, bionic_id> npc::check_toggle_cbm()

Check warning on line 500 in src/bionics.cpp

View workflow job for this annotation

GitHub Actions / build

return type 'const std::map<item, bionic_id>' (aka 'const map<item, string_id<bionic_data>>') is 'const'-qualified at the top level, which may reduce code readability without improving const correctness [readability-const-return-type]
{
std::map<item, bionic_id> res;
const float allowed_ratio = static_cast<int>( rules.cbm_reserve ) / 100.0f;
Expand Down
1 change: 1 addition & 0 deletions src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#include "type_id.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "weather.h"
#include "weighted_list.h"
Expand Down
1 change: 1 addition & 0 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
#include "veh_interact.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_selector.h"
#include "vitamin.h"
#include "vpart_position.h"
Expand Down
1 change: 1 addition & 0 deletions src/character_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "trap.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "weather_gen.h"
#include "weather.h"
Expand Down
1 change: 1 addition & 0 deletions src/character_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "uistate.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_selector.h"
#include "vpart_position.h"
#include "weather_gen.h"
Expand Down
1 change: 1 addition & 0 deletions src/character_turn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "trap.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "weather_gen.h"
#include "weather.h"
Expand Down
1 change: 1 addition & 0 deletions src/clzones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "ui.h"
#include "value_ptr.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const std::string flag_FIREWOOD( "FIREWOOD" );
Expand Down
1 change: 1 addition & 0 deletions src/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "string_id.h"
#include "type_id.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

class basecamp;
Expand Down
1 change: 1 addition & 0 deletions src/construction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include "units_serde.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const activity_id ACT_BUILD( "ACT_BUILD" );
Expand Down
1 change: 1 addition & 0 deletions src/crafting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#include "value_ptr.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_selector.h"
#include "vpart_position.h"

Expand Down
1 change: 1 addition & 0 deletions src/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "translations.h"
#include "value_ptr.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const ammo_effect_str_id ammo_effect_APPLY_SAP( "APPLY_SAP" );
Expand Down
1 change: 1 addition & 0 deletions src/debug_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
#include "units_utility.h"
#include "url_utility.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "veh_type.h"
#include "vitamin.h"
#include "vpart_position.h"
Expand Down
1 change: 1 addition & 0 deletions src/distribution_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void distribution_grid::update( time_point to )

// TODO: Shouldn't be here
#include "vehicle.h"
#include "vehicle_part.h"
static itype_id itype_battery( "battery" );
int distribution_grid::mod_resource( int amt, bool recurse )
{
Expand Down
1 change: 1 addition & 0 deletions src/dump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "value_ptr.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vitamin.h"

static const std::string flag_VARSIZE( "VARSIZE" );
Expand Down
1 change: 1 addition & 0 deletions src/editmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "ui_manager.h"
#include "uistate.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static constexpr tripoint editmap_boundary_min( 0, 0, -OVERMAP_DEPTH );
Expand Down
1 change: 1 addition & 0 deletions src/explosion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include "units.h"
#include "ui_manager.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const ammo_effect_str_id ammo_effect_NULL_SOURCE( "NULL_SOURCE" );
Expand Down
1 change: 1 addition & 0 deletions src/faction_camp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#include "value_ptr.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "vpart_range.h"
#include "weather.h"
Expand Down
1 change: 1 addition & 0 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
#include "veh_interact.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "vpart_range.h"
#include "wcwidth.h"
Expand Down
1 change: 1 addition & 0 deletions src/gates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "type_id.h"
#include "units.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

// Gates namespace
Expand Down
1 change: 1 addition & 0 deletions src/grab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "point.h"
#include "sounds.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "debug.h"
#include "rng.h"
Expand Down
1 change: 1 addition & 0 deletions src/handle_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
#include "units.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "vpart_range.h"
#include "weather.h"
Expand Down
1 change: 1 addition & 0 deletions src/handle_liquid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "type_id.h"
#include "ui.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "vpart_range.h"

Expand Down
1 change: 1 addition & 0 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
#include "units_utility.h"
#include "value_ptr.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "weather.h"

Expand Down
1 change: 1 addition & 0 deletions src/inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "options.h"
#include "translations.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "calendar.h"
#include "character.h"
Expand Down
1 change: 1 addition & 0 deletions src/inventory_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "ui_manager.h"
#include "units_utility.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_selector.h"
#include "visitable.h"
#include "vpart_position.h"
Expand Down
1 change: 1 addition & 0 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
#include "units_utility.h"
#include "value_ptr.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vitamin.h"
#include "vpart_position.h"
#include "weather.h"
Expand Down
1 change: 1 addition & 0 deletions src/item_location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "string_formatter.h"
#include "translations.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_selector.h"
#include "visitable.h"
#include "vpart_position.h"
Expand Down
1 change: 1 addition & 0 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
#include "value_ptr.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_selector.h"
#include "visitable.h"
#include "vpart_position.h"
Expand Down Expand Up @@ -2633,7 +2634,7 @@
///\EFFECT_STR modifies dig rate
// Adjust the dig rate if the player is above or below strength of 10.
// Floor it at 1 so we don't divide by zero, of course!
const double attr = 10 / std::max( 1, p->str_cur );

Check warning on line 2637 in src/iuse.cpp

View workflow job for this annotation

GitHub Actions / build

result of integer division used in a floating point context; possible loss of precision [bugprone-integer-division]

// And now determine the moves...
int dig_minutes = deep ? deep_pit_time : shallow_pit_time;
Expand Down
1 change: 1 addition & 0 deletions src/iuse_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#include "units_utility.h"
#include "value_ptr.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_selector.h"
#include "visitable.h"
#include "vitamin.h"
Expand Down
1 change: 1 addition & 0 deletions src/lightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "type_id.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "vpart_range.h"
#include "weather.h"
Expand Down
1 change: 1 addition & 0 deletions src/magic_spell_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "type_id.h"
#include "units.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const ammo_effect_str_id ammo_effect_magic( "magic" );
Expand Down
1 change: 1 addition & 0 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
#include "value_ptr.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "visitable.h"
#include "vpart_position.h"
#include "vpart_range.h"
Expand All @@ -117,7 +118,7 @@
static const itype_id itype_forge( "forge" );
static const itype_id itype_hotplate( "hotplate" );
static const itype_id itype_kiln( "kiln" );
static const itype_id itype_nail( "nail" );

Check warning on line 121 in src/map.cpp

View workflow job for this annotation

GitHub Actions / build

Variable 'itype_nail' declared but not used. [cata-unused-statics]
static const itype_id itype_press( "press" );
static const itype_id itype_soldering_iron( "soldering_iron" );
static const itype_id itype_vac_sealer( "vac_sealer" );
Expand Down
1 change: 1 addition & 0 deletions src/map_extras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include "units.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_group.h"
#include "vpart_position.h"
#include "vpart_range.h"
Expand Down
1 change: 1 addition & 0 deletions src/map_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include "type_id.h"
#include "units.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "weather.h"

Expand Down
1 change: 1 addition & 0 deletions src/mapgen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "trap.h"
#include "value_ptr.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vehicle_group.h"
#include "vpart_position.h"
#include "vpart_range.h"
Expand All @@ -83,9 +84,9 @@
static const mongroup_id GROUP_HAZMATBOT( "GROUP_HAZMATBOT" );
static const mongroup_id GROUP_LAB( "GROUP_LAB" );
static const mongroup_id GROUP_LAB_CYBORG( "GROUP_LAB_CYBORG" );
static const mongroup_id GROUP_NETHER( "GROUP_NETHER" );

Check warning on line 87 in src/mapgen.cpp

View workflow job for this annotation

GitHub Actions / build

Variable 'GROUP_NETHER' declared but not used. [cata-unused-statics]
static const mongroup_id GROUP_PLAIN( "GROUP_PLAIN" );
static const mongroup_id GROUP_ROBOT_SECUBOT( "GROUP_ROBOT_SECUBOT" );

Check warning on line 89 in src/mapgen.cpp

View workflow job for this annotation

GitHub Actions / build

Variable 'GROUP_ROBOT_SECUBOT' declared but not used. [cata-unused-statics]
static const mongroup_id GROUP_SEWER( "GROUP_SEWER" );
static const mongroup_id GROUP_SPIDER( "GROUP_SPIDER" );
static const mongroup_id GROUP_TRIFFID( "GROUP_TRIFFID" );
Expand Down
1 change: 1 addition & 0 deletions src/mattack_actors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "sounds.h"
#include "translations.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_range.h"

static const efftype_id effect_badpoison( "badpoison" );
Expand Down
1 change: 1 addition & 0 deletions src/melee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include "type_id.h"
#include "units.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"
#include "weighted_list.h"

Expand Down
1 change: 1 addition & 0 deletions src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "translations.h"
#include "trap.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "vpart_position.h"

static const efftype_id effect_ai_waiting( "ai_waiting" );
Expand Down Expand Up @@ -119,7 +120,7 @@
bool monster::will_move_to( const tripoint &p ) const
{
if( g->m.impassable( p ) ) {
tripoint above_p( p.x, p.y, p.z + 1 );

Check warning on line 123 in src/monmove.cpp

View workflow job for this annotation

GitHub Actions / build

Construction of 'tripoint' can be simplified. [cata-simplify-point-constructors]

Check warning on line 123 in src/monmove.cpp

View workflow job for this annotation

GitHub Actions / build

Construction of 'tripoint' can be simplified using overloaded arithmetic operators. [cata-use-point-arithmetic]
if( digging() ) {
if( !g->m.has_flag( "BURROWABLE", p ) ) {
return false;
Expand Down Expand Up @@ -1582,7 +1583,7 @@
// Allows climbing monsters to move on terrain with movecost <= 0
Creature *critter = g->critter_at( destination, is_hallucination() );
if( g->m.has_flag( "CLIMBABLE", destination ) ) {
tripoint above_dest( destination.x, destination.y, destination.z + 1 );

Check warning on line 1586 in src/monmove.cpp

View workflow job for this annotation

GitHub Actions / build

Construction of 'tripoint' can be simplified. [cata-simplify-point-constructors]

Check warning on line 1586 in src/monmove.cpp

View workflow job for this annotation

GitHub Actions / build

Construction of 'tripoint' can be simplified using overloaded arithmetic operators. [cata-use-point-arithmetic]
if( g->m.impassable( destination ) && critter == nullptr &&
!g->m.has_floor_or_support( above_dest ) ) {
if( flies() ) {
Expand Down
1 change: 1 addition & 0 deletions src/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
#include "value_ptr.h"
#include "veh_type.h"
#include "vehicle.h"
#include "vehicle_part.h"
#include "visitable.h"
#include "vpart_position.h"
#include "vpart_range.h"
Expand Down
Loading
Loading