starting playing the wherigo
Signed-off-by: Peter Siegmund <mars3142@noreply.mars3142.dev>
This commit is contained in:
43
main/include/app.h
Normal file
43
main/include/app.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include <cartridge/cartridge.h>
|
||||
#include <wx/wx.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
extern "C" {
|
||||
struct lua_State;
|
||||
}
|
||||
|
||||
class cApp : public wxApp
|
||||
{
|
||||
public:
|
||||
bool OnInit() override;
|
||||
int OnExit() override;
|
||||
|
||||
bool loadCartridge(const std::string &filePath);
|
||||
void startGame();
|
||||
void unloadCartridge();
|
||||
|
||||
// Save/Load game state
|
||||
bool saveGameState(const std::string &saveFilePath);
|
||||
bool loadGameState(const std::string &saveFilePath);
|
||||
std::string getAutoSavePath() const;
|
||||
|
||||
// Generate completion log (for wherigo.com)
|
||||
bool generateCompletionLog(const std::string &logFilePath);
|
||||
std::string getCompletionLogPath() const;
|
||||
|
||||
lua_State* getLuaState() const { return m_luaState; }
|
||||
int getCartridgeRef() const { return m_cartridgeRef; }
|
||||
cartridge::Cartridge* getCartridge() const { return m_cartridge.get(); }
|
||||
bool isCartridgeLoaded() const { return m_cartridge != nullptr; }
|
||||
|
||||
private:
|
||||
bool initLuaState();
|
||||
|
||||
lua_State* m_luaState = nullptr;
|
||||
int m_cartridgeRef = -1; // LUA_NOREF
|
||||
std::unique_ptr<cartridge::Cartridge> m_cartridge;
|
||||
std::string m_cartridgePath;
|
||||
};
|
||||
Reference in New Issue
Block a user