Results of today's code review session.

This commit is contained in:
Zed A. Shaw 2025-01-05 15:07:30 -05:00
parent 14b3ea7676
commit f35b74f335
21 changed files with 64 additions and 59 deletions

View file

@ -29,4 +29,14 @@ namespace components {
dbc::check(at < items.size(), fmt::format("inventory index {} too big", at));
items.erase(items.begin() + at);
}
int Inventory::item_index(std::string id) {
for(size_t i = 0; i < items.size(); i++) {
if(items[i].data["id"] == id) {
return i;
}
}
return -1;
}
}