Added ped model data. (#349)

This commit is contained in:
aa15032261
2022-07-19 18:19:19 +08:00
committed by GitHub
parent c9e6ed5db2
commit 18ab39394f
13 changed files with 492 additions and 199 deletions

View File

@ -0,0 +1,46 @@
#include "vehicle_item.hpp"
namespace big
{
vehicle_item::vehicle_item()
{
this->name = "";
this->display_name = "";
this->display_manufacturer = "";
this->clazz = "";
this->hash = 0;
}
vehicle_item::vehicle_item(nlohmann::json& item_json)
{
this->name = item_json["Name"];
this->display_name = item_json["Name"];
this->display_manufacturer = "";
this->clazz = "";
this->hash = item_json["Hash"];
if (!item_json["DisplayName"].is_null())
{
this->display_name = item_json["DisplayName"];
}
if (!item_json["ManufacturerDisplayName"].is_null())
{
this->display_manufacturer = item_json["ManufacturerDisplayName"];
}
else if (!item_json["Manufacturer"].is_null())
{
this->display_manufacturer = item_json["Manufacturer"];
}
if (!item_json["Class"].is_null())
{
this->clazz = item_json["Class"];
std::transform(this->clazz.begin(), this->clazz.end(), this->clazz.begin(), ::toupper);
if (this->clazz == "COMPACTS")
{
this->clazz = "COMPACT";
}
}
}
}