open-story-teller/shared/story_db.cpp
anthony@rabine.fr fe920f4b15
Some checks failed
build-story-editor / build_linux (push) Has been cancelled
build-story-editor / build_win32 (push) Has been cancelled
Deploy / deploy (push) Has been cancelled
(WIP) new Download manager, download of commercial DB
2025-01-03 13:21:47 +01:00

47 lines
684 B
C++

#include "story_db.h"
StoryDb::StoryDb()
{
}
StoryDb::~StoryDb()
{
}
bool StoryDb::FindStory(const std::string &uuid, Info &info)
{
for (const auto &s : m_store)
{
if (s.uuid == uuid)
{
info = s;
return true;
}
}
for (const auto &s : m_commercialStore)
{
if (s.uuid == uuid)
{
info = s;
return true;
}
}
return false;
}
void StoryDb::AddStory(IStoryDb::Info &info, int origin)
{
if (origin == cCommercialStore)
{
m_commercialStore.push_back(info);
}
if (origin == cCommunityStore)
{
m_store.push_back(info);
}
}