Skip to content

Commit

Permalink
Deprecate get_location_name without game
Browse files Browse the repository at this point in the history
  • Loading branch information
black-sliver committed Sep 4, 2024
1 parent 937cd8d commit 15cf63c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions apclient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ class APClient {
return BLANK;
}

std::string get_location_name(int64_t code, const std::string& game="")
std::string get_location_name(int64_t code, const std::string& game)
{
if (game.empty()) { // old code path ("global" ids)
auto it = _locations.find(code);
Expand All @@ -693,6 +693,12 @@ class APClient {
return "Unknown";
}

[[deprecated("Use the overload that explicitly takes game argument")]]
std::string get_location_name(int64_t code)
{
return get_location_name(code, "");
}

/*Usage is not recommended
* Return the id associated with the location name
* Return APClient::INVALID_NAME_ID when undefined*/
Expand All @@ -707,7 +713,7 @@ class APClient {
return INVALID_NAME_ID;
}

std::string get_item_name(int64_t code, const std::string& game="")
std::string get_item_name(int64_t code, const std::string& game)
{
if (game.empty()) { // old code path ("global" ids)
auto it = _items.find(code);
Expand All @@ -725,6 +731,12 @@ class APClient {
return "Unknown";
}

[[deprecated("Use the overload that explicitly takes game argument")]]
std::string get_item_name(int64_t code)
{
return get_item_name(code, "");
}

/*Usage is not recommended
* Return the id associated with the item name
* Return APClient::INVALID_NAME_ID when undefined*/
Expand Down

0 comments on commit 15cf63c

Please sign in to comment.