og-edopro/gframe/data_handler.h
Edoardo Lolletti 8e3e8c8341 Handle irrlicht device destruction via shared pointer in DataHandler
Slightly cleaner code and fixes an issue when using sdl mixer audio backend and sdl device in irrlicht, where irrlicht's device was being terminated before the audio backend, thus calling SDL_Quit before the audio backend could do its cleanup
2024-12-03 21:25:07 +01:00

41 lines
932 B
C++

#ifndef DATA_LOADER_H
#define DATA_LOADER_H
#include <memory>
#include "image_downloader.h"
#include "repo_manager.h"
#include "game_config.h"
#include "sound_manager.h"
#include "data_manager.h"
#include "deck_manager.h"
namespace irr {
class IrrlichtDevice;
namespace io {
class IFileSystem;
}
}
namespace ygo {
class DataHandler {
irr::io::IFileSystem* filesystem{ nullptr };
void LoadDatabases();
void LoadZipArchives();
void LoadArchivesDB();
void LoadPicUrls();
public:
DataHandler();
~DataHandler();
std::shared_ptr<irr::IrrlichtDevice> tmp_device{ nullptr };
std::unique_ptr<DeckManager> deckManager{ nullptr };
std::unique_ptr<RepoManager> gitManager{ nullptr };
std::unique_ptr<GameConfig> configs{ nullptr };
std::unique_ptr<SoundManager> sounds{ nullptr };
std::unique_ptr<DataManager> dataManager{ nullptr };
std::unique_ptr<ImageDownloader> imageDownloader{ nullptr };
};
}
#endif // DATA_LOADER_H