#ifndef __ALE_INTERFACE_HPP__
#define __ALE_INTERFACE_HPP__
#include "emucore/FSNode.hxx"
#include "emucore/OSystem.hxx"
#include "os_dependent/SettingsWin32.hxx"
#include "os_dependent/OSystemWin32.hxx"
#include "os_dependent/SettingsUNIX.hxx"
#include "os_dependent/OSystemUNIX.hxx"
#include "games/Roms.hpp"
#include "common/display_screen.h"
#include "environment/stella_environment.hpp"
#include "common/ScreenExporter.hpp"
#include "common/Log.hpp"
#include <string>
#include <memory>
namespace ale {
static const std::string Version = "0.6.0";
class ALEInterface {
public:
ALEInterface();
~ALEInterface();
ALEInterface(bool display_screen);
std::string getString(const std::string& key);
int getInt(const std::string& key);
bool getBool(const std::string& key);
float getFloat(const std::string& key);
void setString(const std::string& key, const std::string& value);
void setInt(const std::string& key, const int value);
void setBool(const std::string& key, const bool value);
void setFloat(const std::string& key, const float value);
void loadROM(std::string rom_file);
reward_t act(Action action);
bool game_over() const;
void reset_game();
ModeVect getAvailableModes();
void setMode(game_mode_t m);
DifficultyVect getAvailableDifficulties();
void setDifficulty(difficulty_t m);
ActionVect getLegalActionSet();
ActionVect getMinimalActionSet();
int getFrameNumber();
int lives();
int getEpisodeFrameNumber() const;
const ALEScreen& getScreen();
void getScreenGrayscale(std::vector<unsigned char>& grayscale_output_buffer);
void getScreenRGB(std::vector<unsigned char>& output_rgb_buffer);
const ALERAM& getRAM();
void saveState();
void loadState();
ALEState cloneState();
void restoreState(const ALEState& state);
ALEState cloneSystemState();
void restoreSystemState(const ALEState& state);
void saveScreenPNG(const std::string& filename);
ScreenExporter* createScreenExporter(const std::string& path) const;
public:
std::unique_ptr<OSystem> theOSystem;
std::unique_ptr<Settings> theSettings;
std::unique_ptr<RomSettings> romSettings;
std::unique_ptr<StellaEnvironment> environment;
int max_num_frames;
public:
static std::string welcomeMessage();
static void disableBufferedIO();
static void createOSystem(std::unique_ptr<OSystem>& theOSystem,
std::unique_ptr<Settings>& theSettings);
static void loadSettings(const std::string& romfile,
std::unique_ptr<OSystem>& theOSystem);
private:
static bool isSupportedRom(std::unique_ptr<OSystem>& theOSystem);
};
}
#endif