Mesen-X/Core/BatteryManager.h
Souryo 850102bbdc Input: Added support for ~20 new peripherals (Incomplete, more fixes/changes to come)
Movies: Rewrote format to support all IO devices and console types
Netplay: Now supports all IO devices and console types
2017-11-19 23:08:23 -05:00

37 lines
No EOL
876 B
C++

#pragma once
#include "stdafx.h"
class IBatteryProvider
{
public:
virtual vector<uint8_t> LoadBattery(string extension) = 0;
};
class IBatteryRecorder
{
public:
virtual void OnLoadBattery(string extension, vector<uint8_t> batteryData) = 0;
};
class BatteryManager
{
private:
static string _romName;
static string GetBasePath();
static std::weak_ptr<IBatteryProvider> _provider;
static std::weak_ptr<IBatteryRecorder> _recorder;
BatteryManager() = delete;
public:
static void Initialize(string romName);
static void SetBatteryProvider(shared_ptr<IBatteryProvider> provider);
static void SetBatteryRecorder(shared_ptr<IBatteryRecorder> recorder);
static void SaveBattery(string extension, uint8_t* data, uint32_t length);
static vector<uint8_t> LoadBattery(string extension);
static void LoadBattery(string extension, uint8_t* data, uint32_t length);
};