SkyPortal-plugin/Source/SkyPortal/Private/SkyPortalFigure.cpp

58 lines
1.4 KiB
C++
Raw Normal View History

#pragma once
#include "SkyPortalFigure.h"
2024-09-29 09:36:40 +00:00
UFigureData::UFigureData()
{
ClearData();
2024-09-29 15:43:07 +00:00
GenerationID = EVariantIDGeneration::UNKNOW;
2024-09-29 09:36:40 +00:00
}
2024-09-26 13:01:42 +00:00
2024-09-29 09:36:40 +00:00
int32 UFigureData::GetFigureID()
{
2024-09-26 13:01:42 +00:00
if (ID == 0) {
int16_t OutFigureID = 0;
// The figure ID is stored in Block 1 of Sector 0 (i.e., data[1]), bytes 0 and 1 (16-bit integer, little-endian)
2024-09-26 23:39:33 +00:00
OutFigureID = decryptedData[1][0] | // Least significant byte
2024-09-26 13:01:42 +00:00
(data[1][1] << 8); // Most significant byte, shifted left by 8 bits
ID = OutFigureID;// Return the 16-bit figure ID
return OutFigureID;
}
else { return ID; }
/*
// Variant ID is stored in Block 0, bytes 4 to 5 (16-bit integer, little-endian)
OutVariantID = (DataBlock.blockdata[0][5] << 8) |
DataBlock.blockdata[0][4];
*/
2024-09-26 13:01:42 +00:00
};
2024-09-29 15:43:07 +00:00
int32 UFigureData::GetVariantID() {
int16_t OutFigureID = 0;
// The figure ID is stored in Block 1 of Sector 0 (i.e., data[1]), bytes 0 and 1 (16-bit integer, little-endian)
OutFigureID = decryptedData[1][0] | // Least significant byte
(data[1][1] << 8); // Most significant byte, shifted left by 8 bits
VariantID = OutFigureID;// Return the 16-bit figure ID
return OutFigureID;
}
EVariantIDGeneration UFigureData::GetGeneration()
{
return static_cast<EVariantIDGeneration>(VariantID);
}
2024-09-29 09:36:40 +00:00
void UFigureData::ClearData()
{
}
2024-09-29 15:43:07 +00:00
bool UFigureData::Dump(bool decrypted, FString filePath)
{
return true;
}