1#include "ObjectFlowTable.hh"
3#include "game/system/ResourceManager.hh"
10ObjectFlowTable::ObjectFlowTable(
const char *filename) {
11 SFile *file =
reinterpret_cast<SFile *
>(System::ResourceManager::Instance()->getFile(filename,
12 nullptr, System::ArchiveId::Core));
14 m_count = parse<s16>(file->count);
16 m_slots =
reinterpret_cast<const s16 *
>(m_sets + m_count);
20ObjectFlowTable::~ObjectFlowTable() =
default;
23ObjectId ObjectFlowTable::getIdfFromName(
const char *name)
const {
24 for (s16 i = 0; i < m_count; ++i) {
25 const auto *curSet = set(i);
28 if (strncmp(name, curSet->name,
sizeof(curSet->name)) == 0) {
29 return static_cast<ObjectId
>(parse<u16>(curSet->id));
33 return ObjectId::None;