9#include <SFML/Window/Event.hpp>
43 bool is_active() const noexcept {
return m_is_active; }
70 bool m_is_active{
false};
73 std::optional<program_state> m_next_state;
76 virtual void draw_impl() = 0;
79 virtual bool process_event_impl(sf::Event& e) = 0;
82 virtual void process_resize_event_impl(sf::Event& event) = 0;
85 virtual void start_impl() = 0;
88 virtual void stop_impl() = 0;
91 virtual void tick_impl(
const delta_t dt) = 0;
A change of in_game_time}.
Definition delta_t.h:12
The abstract base class of all other views.
Definition view.h:26
void set_is_active(const bool is_active)
Set if this window is active.
Definition view.cpp:48
view()
Definition view.cpp:10
void stop()
Clean up after this window has been shown.
Definition view.cpp:76
void draw()
Draw the menu on the main window.
Definition view.cpp:32
virtual ~view()
Definition view.cpp:15
void clear_next_state()
Clear the next state.
Definition view.cpp:21
void set_next_state(const program_state next_state)
Set the next state to go to.
Definition view.cpp:54
void tick(const delta_t dt)
Run the game, until the user quits.
Definition view.cpp:82
void process_resize_event(sf::Event &event)
Process a resize event.
Definition view.cpp:42
bool process_event(sf::Event &e)
Process an event.
Definition view.cpp:37
const auto & get_next_state() const noexcept
The next state to go to, if any.
Definition view.h:38
bool is_active() const noexcept
Is this window active?
Definition view.h:43
void start()
Prepare this window for being shown.
Definition view.cpp:70
program_state
Definition program_state.h:7