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

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

uint32_t AreaTableRec::GetNumColumns() {
    return 36;
}

uint32_t AreaTableRec::GetRowSize() {
    return 144;
}

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

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

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

bool AreaTableRec::Read(SFile* f, const char* stringBuffer) {
    uint32_t areaNameOfs[16];
    uint32_t areaNameMask;

    if (
        !SFile::Read(f, &this->m_ID, sizeof(this->m_ID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_continentID, sizeof(this->m_continentID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_parentAreaID, sizeof(this->m_parentAreaID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_areaBit, sizeof(this->m_areaBit), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_flags, sizeof(this->m_flags), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_soundProviderPref, sizeof(this->m_soundProviderPref), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_soundProviderPrefUnderwater, sizeof(this->m_soundProviderPrefUnderwater), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_ambienceID, sizeof(this->m_ambienceID), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_zoneMusic, sizeof(this->m_zoneMusic), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_introSound, sizeof(this->m_introSound), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_explorationLevel, sizeof(this->m_explorationLevel), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[0], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[1], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[2], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[3], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[4], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[5], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[6], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[7], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[8], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[9], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[10], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[11], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[12], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[13], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[14], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameOfs[15], sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &areaNameMask, sizeof(uint32_t), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_factionGroupMask, sizeof(this->m_factionGroupMask), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_liquidTypeID[0], sizeof(m_liquidTypeID[0]), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_liquidTypeID[1], sizeof(m_liquidTypeID[0]), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_liquidTypeID[2], sizeof(m_liquidTypeID[0]), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_liquidTypeID[3], sizeof(m_liquidTypeID[0]), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_minElevation, sizeof(this->m_minElevation), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_ambientMultiplier, sizeof(this->m_ambientMultiplier), nullptr, nullptr, nullptr)
        || !SFile::Read(f, &this->m_lightID, sizeof(this->m_lightID), nullptr, nullptr, nullptr)
    ) {
        return false;
    }

    if (stringBuffer) {
        this->m_areaName = &stringBuffer[areaNameOfs[CURRENT_LANGUAGE]];
    } else {
        this->m_areaName = "";
    }

    return true;
}
