mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
53 lines
1 KiB
Cheetah
53 lines
1 KiB
Cheetah
#include "ExdDataGenerated.h"
|
|
#include <memory>
|
|
CONSTRUCTORS
|
|
|
|
Sapphire::Data::ExdDataGenerated::ExdDataGenerated()
|
|
{
|
|
}
|
|
|
|
Sapphire::Data::ExdDataGenerated::~ExdDataGenerated()
|
|
{
|
|
}
|
|
|
|
xiv::exd::Exd Sapphire::Data::ExdDataGenerated::setupDatAccess( const std::string& name, xiv::exd::Language lang )
|
|
{
|
|
auto& cat = m_exd_data->get_category( name );
|
|
return static_cast< xiv::exd::Exd >( cat.get_data_ln( lang ) );
|
|
};
|
|
|
|
|
|
void Sapphire::Data::ExdDataGenerated::loadIdList( xiv::exd::Exd& data, std::set< uint32_t >& outIdList )
|
|
{
|
|
auto pDataRows = data.get_rows();
|
|
|
|
for( auto row : pDataRows )
|
|
{
|
|
uint32_t id = row.first.rowId;
|
|
outIdList.insert( id );
|
|
}
|
|
}
|
|
|
|
bool Sapphire::Data::ExdDataGenerated::init( const std::string& path )
|
|
{
|
|
try
|
|
{
|
|
m_data = std::make_shared< xiv::dat::GameData >( path );
|
|
m_exd_data = std::make_shared< xiv::exd::ExdData >( *m_data );
|
|
|
|
SETUPDATACCESS
|
|
}
|
|
catch( std::runtime_error )
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////
|
|
// DIRECT GETTERS
|
|
DIRECTGETTERS
|
|
|
|
|
|
|