// DO NOT EDIT: generated by whoa-autocode
#include "db/rec/CreatureDisplayInfoRec.hpp"
#include "util/Locale.hpp"
#include "util/SFile.hpp"

const char* CreatureDisplayInfoRec::GetFilename() {
    return "DBFilesClient\\CreatureDisplayInfo.dbc";
}

uint32_t CreatureDisplayInfoRec::GetNumColumns() {
    return 16;
}

uint32_t CreatureDisplayInfoRec::GetRowSize() {
    return 64;
}

bool CreatureDisplayInfoRec::NeedIDAssigned() {
    return false;
}

int32_t CreatureDisplayInfoRec::GetID() {
    return this->m_ID;
}

void CreatureDisplayInfoRec::SetID(int32_t id) {
    this->m_ID = id;
}

bool CreatureDisplayInfoRec::Read(SFile* f, const char* stringBuffer) {
    uint32_t textureVariationOfs[3];
    uint32_t portraitTextureNameOfs;

    if (
        !SFile::Read(f, &this->m_ID, sizeof(this->m_ID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_modelID, sizeof(this->m_modelID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_soundID, sizeof(this->m_soundID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_extendedDisplayInfoID, sizeof(this->m_extendedDisplayInfoID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_creatureModelScale, sizeof(this->m_creatureModelScale), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_creatureModelAlpha, sizeof(this->m_creatureModelAlpha), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &textureVariationOfs[0], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &textureVariationOfs[1], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &textureVariationOfs[2], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &portraitTextureNameOfs, sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_sizeClass, sizeof(this->m_sizeClass), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_bloodID, sizeof(this->m_bloodID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_npcsoundID, sizeof(this->m_npcsoundID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_particleColorID, sizeof(this->m_particleColorID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_creatureGeosetData, sizeof(this->m_creatureGeosetData), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_objectEffectPackageID, sizeof(this->m_objectEffectPackageID), nullptr, nullptr, nullptr)
    ) {
        return false;
    }

    if (stringBuffer) {
        this->m_textureVariation[0] = &stringBuffer[textureVariationOfs[0]];
        this->m_textureVariation[1] = &stringBuffer[textureVariationOfs[1]];
        this->m_textureVariation[2] = &stringBuffer[textureVariationOfs[2]];
        this->m_portraitTextureName = &stringBuffer[portraitTextureNameOfs];
    } else {
        this->m_textureVariation[0] = "";
        this->m_textureVariation[1] = "";
        this->m_textureVariation[2] = "";
        this->m_portraitTextureName = "";
    }

    return true;
}
