The Battle for Wesnoth  1.15.1+dev
hotkey_handler_mp.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2018 by Chris Beck <render787@gmail.com>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file
17  * An extension of playsingle_controller::hotkey_handler, which has support for
18  * MP wesnoth features like network traffic
19  */
20 
21 #pragma once
22 
23 #include "playmp_controller.hpp"
25 
27 
28 protected:
30 
31 public:
34 
35  virtual void speak() override;
36  virtual void whisper() override;
37  virtual void shout() override;
38  virtual void start_network() override;
39  virtual void stop_network() override;
40  virtual bool can_execute_command(const hotkey::hotkey_command& command, int index=-1) const override;
41 
42 };
hotkey_handler(playmp_controller &, saved_game &)
virtual void start_network() override
Stores all information related to functions that can be bound to hotkeys.
virtual void stop_network() override
An extension of play_controller::hotkey_handler, which has support for SP wesnoth features like white...
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
Definition: unicode.cpp:71
virtual bool can_execute_command(const hotkey::hotkey_command &command, int index=-1) const override
Check if a command can be executed.