Load item tables + price implementation

This commit is contained in:
Gent
2020-09-14 00:25:14 -04:00
parent f55cc8f36d
commit c91022030c
4 changed files with 44 additions and 7 deletions

View File

@@ -7,6 +7,7 @@
#include <string.h> // for memset() and memcmp()
#include <assert.h>
std::map<std::pair<int32_t, int32_t>, Item> ItemManager::ItemData;
std::map<int32_t, std::vector<VendorListing>> ItemManager::VendorTables;
void ItemManager::init() {
@@ -749,3 +750,11 @@ int ItemManager::findFreeSlot(Player *plr) {
// not found
return -1;
}
bool ItemManager::isItemRegistered(int32_t id, int32_t type) {
return ItemData.find(std::pair<int32_t, int32_t>(id, type)) != ItemData.end();
}
Item ItemManager::getItemData(int32_t id, int32_t type) {
return ItemData[std::pair<int32_t, int32_t>(id, type)];
}