Skip to content

Commit

Permalink
Remove more now unused untyped overloads
Browse files Browse the repository at this point in the history
Yay dominoes
  • Loading branch information
Procyonae committed Dec 21, 2024
1 parent 6e766e6 commit c472502
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 67 deletions.
51 changes: 0 additions & 51 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6252,20 +6252,6 @@ std::list<item_location> map::items_with( const tripoint_bub_ms &p,
return ret;
}

std::list<item> map::use_amount( const std::vector<tripoint> &reachable_pts, const itype_id &type,
int &quantity, const std::function<bool( const item & )> &filter, bool select_ind )
{
std::vector<tripoint_bub_ms> temp;
temp.reserve( reachable_pts.size() );

for( const tripoint p : reachable_pts ) {
const tripoint_bub_ms pt( p );
temp.emplace_back( pt );
}

return map::use_amount( temp, type, quantity, filter, select_ind );
}

std::list<item> map::use_amount( const std::vector<tripoint_bub_ms> &reachable_pts,
const itype_id &type,
int &quantity, const std::function<bool( const item & )> &filter, bool select_ind )
Expand Down Expand Up @@ -6374,22 +6360,6 @@ static void use_charges_from_furn( const furn_t &f, const itype_id &type, int &q
}
}

std::list<item> map::use_charges( const std::vector<tripoint> &reachable_pts,
const itype_id &type, int &quantity,
const std::function<bool( const item & )> &filter,
basecamp *bcp, bool in_tools )
{
std::vector<tripoint_bub_ms> temp;
temp.reserve( reachable_pts.size() );

for( tripoint p : reachable_pts ) {
const tripoint_bub_ms pt( p );
temp.emplace_back( pt );
}

return map::use_charges( temp, type, quantity, filter, bcp, in_tools );
}

std::list<item> map::use_charges( const std::vector<tripoint_bub_ms> &reachable_pts,
const itype_id &type, int &quantity,
const std::function<bool( const item & )> &filter,
Expand Down Expand Up @@ -6446,14 +6416,6 @@ std::list<item> map::use_charges( const std::vector<tripoint_bub_ms> &reachable_
return ret;
}

std::list<item> map::use_charges( const tripoint &origin, const int range,
const itype_id &type, int &quantity,
const std::function<bool( const item & )> &filter,
basecamp *bcp, bool in_tools )
{
return map::use_charges( tripoint_bub_ms( origin ), range, type, quantity, filter, bcp, in_tools );
}

std::list<item> map::use_charges( const tripoint_bub_ms &origin, const int range,
const itype_id &type, int &quantity,
const std::function<bool( const item & )> &filter,
Expand All @@ -6464,19 +6426,6 @@ std::list<item> map::use_charges( const tripoint_bub_ms &origin, const int range
return use_charges( reachable_pts, type, quantity, filter, bcp, in_tools );
}

units::energy map::consume_ups( const std::vector<tripoint> &reachable_pts, units::energy qty )
{
std::vector<tripoint_bub_ms> temp;
temp.reserve( reachable_pts.size() );

for( const tripoint p : reachable_pts ) {
const tripoint_bub_ms pt( p );
temp.emplace_back( pt );
}

return map::consume_ups( temp, qty );
}

units::energy map::consume_ups( const std::vector<tripoint_bub_ms> &reachable_pts,
units::energy qty )
{
Expand Down
17 changes: 1 addition & 16 deletions src/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -1567,33 +1567,20 @@ class map
std::list<item> use_amount( const tripoint_bub_ms &origin, int range, const itype_id &type,
int &quantity,
const std::function<bool( const item & )> &filter = return_true<item>, bool select_ind = false );
// TODO: Get rid of untyped overload.
std::list<item> use_amount( const std::vector<tripoint> &reachable_pts, const itype_id &type,
int &quantity,
const std::function<bool( const item & )> &filter = return_true<item>, bool select_ind = false );
std::list<item> use_amount( const std::vector<tripoint_bub_ms> &reachable_pts, const itype_id &type,
int &quantity,
const std::function<bool( const item & )> &filter = return_true<item>, bool select_ind = false );
// TODO: Get rid of untyped overload.
std::list<item> use_charges( const tripoint &origin, int range, const itype_id &type,
int &quantity, const std::function<bool( const item & )> &filter = return_true<item>,
basecamp *bcp = nullptr, bool in_tools = false );
std::list<item> use_charges( const tripoint_bub_ms &origin, int range, const itype_id &type,
int &quantity, const std::function<bool( const item & )> &filter = return_true<item>,
basecamp *bcp = nullptr, bool in_tools = false );
// TODO: Get rid of untyped overload.
std::list<item> use_charges( const std::vector<tripoint> &reachable_pts, const itype_id &type,
int &quantity,
const std::function<bool( const item & )> &filter = return_true<item>,
basecamp *bcp = nullptr, bool in_tools = false );
std::list<item> use_charges( const std::vector<tripoint_bub_ms> &reachable_pts,
const itype_id &type,
int &quantity,
const std::function<bool( const item & )> &filter = return_true<item>,
basecamp *bcp = nullptr, bool in_tools = false );

/** Find items located at point p (on map or in vehicles) that pass the filter */
// TODO: Get rid of untyped overload.
// TODO: Get rid of untyped overload, should be removable once #78677 merges.
std::list<item_location> items_with( const tripoint &p,
const std::function<bool( const item & )> &filter );
std::list<item_location> items_with( const tripoint_bub_ms &p,
Expand All @@ -1606,8 +1593,6 @@ class map
* @param qty amount of energy to consume. Is rounded down to kJ precision. Do not use negative values.
* @return Actual amount of energy consumed
*/
// TODO: Get rid of untyped overload.
units::energy consume_ups( const std::vector<tripoint> &reachable_pts, units::energy qty );
units::energy consume_ups( const std::vector<tripoint_bub_ms> &reachable_pts, units::energy qty );
units::energy consume_ups( const tripoint_bub_ms &origin, int range, units::energy qty );

Expand Down

0 comments on commit c472502

Please sign in to comment.