aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/BaseGameTab.hpp
blob: 4c338cf93b410a061b28c0f101f2d8a29e7950bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

#include "gamebase/GameBase.hpp"
#include "gamebase/PGNGameBase.hpp"
#include "ochess.hpp"

// Foreign events
wxDECLARE_EVENT(OPEN_GAME_EVENT, wxCommandEvent);
wxDECLARE_EVENT(REFRESH_TAB_TITLE, wxCommandEvent);
wxDECLARE_EVENT(CLOSE_LINKED_TAB, wxCommandEvent);

class BaseGameTab : public TabBase_TabGames {
  std::shared_ptr<GameBase> base;
  std::vector<std::uint32_t> deleted;
  std::unordered_map<long, std::shared_ptr<Game>> edited;
  std::string base_file;
  TabInfos *main_tab;

public:
  BaseGameTab(wxFrame *parent, std::string base_file, TabInfos *main_tab);

  void ApplyPreferences();
  void LoadFile();
  void OnDelete(wxCommandEvent &event);
  void OnSave(wxCommandEvent &event);
  void OnExport(wxCommandEvent &event);
  void OnOpenGame(wxListEvent &event);
  void OnImport(wxCommandEvent &event);
  std::shared_ptr<Game> GetGame() { return (std::shared_ptr<Game>(NULL)); }
  std::shared_ptr<GameBase> GetBase() { return (std::shared_ptr<GameBase>(base)); };
};