Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Public Member Functions | List of all members
menu_view Class Reference

The main Menu dialog. More...

#include <menu_view.h>

Inheritance diagram for menu_view:
Inheritance graph
[legend]
Collaboration diagram for menu_view:
Collaboration graph
[legend]

Public Member Functions

 menu_view ()
 
void draw_impl () override
 Show the menu on-screen.
 
int get_background_image_index () const noexcept
 Get the index of the background image.
 
const auto & get_layout () const noexcept
 
const auto & get_selected () const noexcept
 
bool process_event_impl (sf::Event &event) override
 Process an event.
 
void process_resize_event_impl (sf::Event &event) override
 Process a resize event.
 
void set_selected (const menu_view_item i)
 Sets the selected item.
 
void start_impl () override
 Start displaying this window.
 
void stop_impl () override
 Clean up after this window has been shown.
 
void tick_impl (const delta_t dt) override
 Run the game, until the user quits.
 
- Public Member Functions inherited from view
 view ()
 
virtual ~view ()
 
void clear_next_state ()
 Clear the next state.
 
void draw ()
 Draw the menu on the main window.
 
const auto & get_next_state () const noexcept
 The next state to go to, if any.
 
bool is_active () const noexcept
 Is this window active?
 
bool process_event (sf::Event &e)
 Process an event.
 
void process_resize_event (sf::Event &event)
 Process a resize event.
 
void set_is_active (const bool is_active)
 Set if this window is active.
 
void set_next_state (const program_state next_state)
 Set the next state to go to.
 
void start ()
 Prepare this window for being shown.
 
void stop ()
 Clean up after this window has been shown.
 
void tick (const delta_t dt)
 Run the game, until the user quits.
 

Detailed Description

The main Menu dialog.

Constructor & Destructor Documentation

◆ menu_view()

menu_view::menu_view ( )

Member Function Documentation

◆ draw_impl()

void menu_view::draw_impl ( )
overridevirtual

Show the menu on-screen.

Implements view.

◆ get_background_image_index()

int menu_view::get_background_image_index ( ) const
inlinenoexcept

Get the index of the background image.

There are multiple possible background images and the one displayed is chosen randomly.

◆ get_layout()

const auto & menu_view::get_layout ( ) const
inlinenoexcept

◆ get_selected()

const auto & menu_view::get_selected ( ) const
inlinenoexcept

◆ process_event_impl()

bool menu_view::process_event_impl ( sf::Event &  event)
overridevirtual

Process an event.

Returns
true if the user wants to quit the program

Implements view.

◆ process_resize_event_impl()

void menu_view::process_resize_event_impl ( sf::Event &  event)
overridevirtual

Process a resize event.

Implements view.

◆ set_selected()

void menu_view::set_selected ( const menu_view_item  i)

Sets the selected item.

If the selected item changes, play sound

◆ start_impl()

void menu_view::start_impl ( )
overridevirtual

Start displaying this window.

Implements view.

◆ stop_impl()

void menu_view::stop_impl ( )
overridevirtual

Clean up after this window has been shown.

Implements view.

◆ tick_impl()

void menu_view::tick_impl ( const delta_t  dt)
overridevirtual

Run the game, until the user quits.

Implements view.


The documentation for this class was generated from the following files: