penguins  1.0.0
player_info_box.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include "game.h"
5 #include <wx/bitmap.h>
6 #include <wx/dc.h>
7 #include <wx/defs.h>
8 #include <wx/event.h>
9 #include <wx/gdicmn.h>
10 #include <wx/sizer.h>
11 #include <wx/stattext.h>
12 #include <wx/string.h>
13 #include <wx/window.h>
14 
16 
18 public:
19  PlayerInfoBox(wxWindow* parent, wxWindowID id, int max_points);
20 
21  void update_data(Game* game, int idx, const wxString& name);
22 
23  const wxBitmap& get_penguin_sprite() const {
24  return this->penguin_sprite;
25  }
26 
27  void paint_penguin_window(wxDC& dc);
28 
29 protected:
35 
36  bool is_blocked = false;
37  bool is_current = false;
39 };
40 
41 class PlayerPenguinWindow : public wxWindow {
42 public:
44 
45  virtual bool AcceptsFocus() const override {
46  return false;
47  }
48 
49 protected:
50  virtual wxSize DoGetBestSize() const override;
51 
52  void on_paint(wxPaintEvent& event);
53 
55 };
void paint_penguin_window(wxDC &dc)
wxBitmap penguin_sprite
wxStaticBoxSizer * root_hbox
wxBoxSizer * info_vbox
const wxBitmap & get_penguin_sprite() const
PlayerInfoBox(wxWindow *parent, wxWindowID id, int max_points)
void update_data(Game *game, int idx, const wxString &name)
PlayerPenguinWindow * penguin_window
wxStaticText * name_text
wxStaticText * score_text
PlayerInfoBox * info_box
virtual wxSize DoGetBestSize() const override
virtual bool AcceptsFocus() const override
PlayerPenguinWindow(PlayerInfoBox *parent, wxWindowID id)
void on_paint(wxPaintEvent &event)
A wxStaticBox with just the border and no label.
The core of the unified game logic library, contains the Game struct.
The central struct of the application, holds the game data and settings.
Definition: game.h:237
int wxWindowID