2017-10-12 09:02:28 +02:00
|
|
|
#include "ExdDataGenerated.h"
|
2019-06-15 20:56:19 +10:00
|
|
|
#include <memory>
|
2017-10-12 09:02:28 +02:00
|
|
|
CONSTRUCTORS
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
Sapphire::Data::ExdDataGenerated::ExdDataGenerated()
|
2017-10-12 00:07:41 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
Sapphire::Data::ExdDataGenerated::~ExdDataGenerated()
|
2017-10-12 00:07:41 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
xiv::exd::Exd Sapphire::Data::ExdDataGenerated::setupDatAccess( const std::string& name, xiv::exd::Language lang )
|
2017-10-12 00:07:41 +02:00
|
|
|
{
|
2019-06-15 20:56:19 +10:00
|
|
|
auto& cat = m_exd_data->get_category( name );
|
|
|
|
return static_cast< xiv::exd::Exd >( cat.get_data_ln( lang ) );
|
2017-10-12 00:07:41 +02:00
|
|
|
};
|
|
|
|
|
2017-11-30 23:41:27 +01:00
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
void Sapphire::Data::ExdDataGenerated::loadIdList( xiv::exd::Exd& data, std::set< uint32_t >& outIdList )
|
2017-11-30 23:41:27 +01:00
|
|
|
{
|
2019-06-15 20:56:19 +10:00
|
|
|
auto pDataRows = data.get_rows();
|
2017-11-30 23:41:27 +01:00
|
|
|
|
2019-06-15 20:56:19 +10:00
|
|
|
for( auto row : pDataRows )
|
|
|
|
{
|
2021-09-13 12:42:31 +02:00
|
|
|
uint32_t id = row.first.rowId;
|
2019-06-15 20:56:19 +10:00
|
|
|
outIdList.insert( id );
|
|
|
|
}
|
2017-11-30 23:41:27 +01:00
|
|
|
}
|
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
bool Sapphire::Data::ExdDataGenerated::init( const std::string& path )
|
2017-10-12 00:07:41 +02:00
|
|
|
{
|
2019-06-15 20:56:19 +10:00
|
|
|
try
|
|
|
|
{
|
|
|
|
m_data = std::make_shared< xiv::dat::GameData >( path );
|
|
|
|
m_exd_data = std::make_shared< xiv::exd::ExdData >( *m_data );
|
2017-10-12 00:07:41 +02:00
|
|
|
|
|
|
|
SETUPDATACCESS
|
2019-06-15 20:56:19 +10:00
|
|
|
}
|
|
|
|
catch( std::runtime_error )
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2017-10-12 00:07:41 +02:00
|
|
|
|
2019-06-15 20:56:19 +10:00
|
|
|
return true;
|
2017-10-12 00:07:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
|
|
// DIRECT GETTERS
|
|
|
|
DIRECTGETTERS
|
|
|
|
|
|
|
|
|
|
|
|
|