mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 00:56:55 +02:00
26 lines
901 B
C++
26 lines
901 B
C++
#pragma once
|
|
#include <memory>
|
|
#include "fat/File.h"
|
|
#include "ICheatRepository.h"
|
|
#include "UsrCheatDat.h"
|
|
|
|
class UsrCheatRepository : public ICheatRepository
|
|
{
|
|
public:
|
|
UsrCheatRepository(std::unique_ptr<File> usrCheatDatFile,
|
|
std::unique_ptr<usr_cheat_index_entry_t[]> sortedIndices, u32 numberOfIndices)
|
|
: _usrCheatFile(std::move(usrCheatDatFile))
|
|
, _sortedIndices(std::move(sortedIndices)), _numberOfIndices(numberOfIndices) { }
|
|
|
|
std::unique_ptr<GameCheats> GetCheatsForGame(u32 gameCode, u32 headerCrc32) const override;
|
|
|
|
private:
|
|
std::unique_ptr<File> _usrCheatFile;
|
|
std::unique_ptr<usr_cheat_index_entry_t[]> _sortedIndices;
|
|
u32 _numberOfIndices;
|
|
|
|
const usr_cheat_index_entry_t* FindIndex(u32 gameCode, u32 headerCrc32) const;
|
|
void ParseCategory(CheatCategory& category, u8*& ptr) const;
|
|
void ParseCheat(Cheat& cheat, u8*& ptr) const;
|
|
};
|