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-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;
|
|
|
|
TabInfos *main_tab;
|
2022-12-23 16:49:33 +01:00
|
|
|
|
|
|
|
public:
|
2022-12-26 12:51:48 +01:00
|
|
|
std::shared_ptr<GameListManager> glm;
|
2022-12-23 16:49:33 +01:00
|
|
|
|
2022-12-26 12:51:48 +01:00
|
|
|
BaseGameTab(wxFrame *parent, std::shared_ptr<GameBase> base, TabInfos *main_tab);
|
|
|
|
|
|
|
|
void Reset(std::shared_ptr<GameBase> base);
|
2022-12-23 16:49:33 +01:00
|
|
|
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-26 12:51:48 +01:00
|
|
|
std::vector<std::shared_ptr<Game>> GetEditedGames();
|
|
|
|
std::vector<std::uint32_t> GetDeletedGameIds() {return(deleted);};
|
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)); };
|
|
|
|
};
|