2022-12-23 16:49:33 +01:00
|
|
|
|
|
|
|
#include "gamebase/GameBase.hpp"
|
|
|
|
#include "gamebase/PGNGameBase.hpp"
|
2022-12-25 15:26:16 +01:00
|
|
|
#include "GameListManager.hpp"
|
2022-12-23 16:49:33 +01:00
|
|
|
|
|
|
|
// Foreign events
|
2022-12-24 12:46:59 +01:00
|
|
|
wxDECLARE_EVENT(OPEN_GAME_EVENT, wxCommandEvent);
|
2022-12-23 16:49:33 +01:00
|
|
|
wxDECLARE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent);
|
2022-12-24 22:30:20 +01:00
|
|
|
wxDECLARE_EVENT(CLOSE_LINKED_TAB, wxCommandEvent);
|
2022-12-23 16:49:33 +01:00
|
|
|
|
|
|
|
class BaseGameTab : public TabBase_TabGames {
|
|
|
|
std::shared_ptr<GameBase> base;
|
|
|
|
std::vector<std::uint32_t> deleted;
|
2022-12-24 22:30:20 +01:00
|
|
|
std::unordered_map<long, std::shared_ptr<Game>> edited;
|
2022-12-23 16:49:33 +01:00
|
|
|
std::string base_file;
|
2022-12-24 22:30:20 +01:00
|
|
|
TabInfos *main_tab;
|
2022-12-25 15:26:16 +01:00
|
|
|
GameListManager *glm;
|
2022-12-23 16:49:33 +01:00
|
|
|
|
|
|
|
public:
|
2022-12-24 22:30:20 +01:00
|
|
|
BaseGameTab(wxFrame *parent, std::string base_file, TabInfos *main_tab);
|
2022-12-25 15:26:16 +01:00
|
|
|
~BaseGameTab() {delete(glm);};
|
2022-12-23 16:49:33 +01:00
|
|
|
|
|
|
|
void ApplyPreferences();
|
|
|
|
void LoadFile();
|
|
|
|
void OnDelete(wxCommandEvent &event);
|
|
|
|
void OnSave(wxCommandEvent &event);
|
|
|
|
void OnExport(wxCommandEvent &event);
|
|
|
|
void OnOpenGame(wxListEvent &event);
|
|
|
|
void OnImport(wxCommandEvent &event);
|
2022-12-25 18:30:56 +01:00
|
|
|
void OnApplyFilter(wxCommandEvent &event);
|
2022-12-23 16:49:33 +01:00
|
|
|
std::shared_ptr<Game> GetGame() { return (std::shared_ptr<Game>(NULL)); }
|
|
|
|
std::shared_ptr<GameBase> GetBase() { return (std::shared_ptr<GameBase>(base)); };
|
|
|
|
};
|