The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mouse_action_village.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2016 by Fabian Mueller <[email protected]>
3  Part of the Battle for Wesnoth Project http://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 #ifndef EDITOR_MOUSE_ACTION_VILLAGE_HPP
16 #define EDITOR_MOUSE_ACTION_VILLAGE_HPP
17 
18 #include "mouse_action.hpp"
19 
20 class CKey;
21 class empty_palette;
22 
23 namespace editor {
24 
25 /**
26  * Editor mouse action class.
27  * Called by the editor tool to assign village ownership to defined sides.
28  */
30 {
31 public:
33  : mouse_action(palette, key)
34  {
35  }
36 
37  /**
38  * No action.
39  */
40  editor_action* click_left(editor_display& /*disp*/, int /*x*/, int /*y*/) {return nullptr;}
41 
42  /**
43  * If clicked on a village hex field, assigns the ownership of it to the current side.
44  */
45  editor_action* up_left(editor_display& disp, int x, int y);
46 
47  /**
48  * No action.
49  */
50  editor_action* click_right(editor_display& /*disp*/, int /*x*/, int /*y*/) {return nullptr;}
51 
52  /**
53  * If clicked on a village hex field, unassigns it's ownership.
54  */
55  editor_action* up_right(editor_display& disp, int x, int y);
56 
57  virtual void set_mouse_overlay(editor_display& disp);
58 };
59 
60 
61 } //end namespace editor
62 
63 #endif
GLint GLint GLint GLint GLint GLint y
Definition: glew.h:1220
virtual void set_mouse_overlay(editor_display &disp)
Set the mouse overlay for this action.
editor_action * up_right(editor_display &disp, int x, int y)
If clicked on a village hex field, unassigns it's ownership.
Manage the empty-palette in the editor.
Definition: action.cpp:28
mouse_action_village(const CKey &key, empty_palette &palette)
Base class for all editor actions.
Definition: action_base.hpp:41
GLint GLint GLint GLint GLint x
Definition: glew.h:1220
editor_action * click_right(editor_display &, int, int)
No action.
Editor mouse action class.
A mouse action receives events from the controller, and responds to them by creating an appropriate e...
Class that keeps track of all the keys on the keyboard.
Definition: key.hpp:27
editor_action * click_left(editor_display &, int, int)
No action.
std::vector< Uint32 > palette(color_range cr)
Creates a reference color palette from a color range.
editor_action * up_left(editor_display &disp, int x, int y)
If clicked on a village hex field, assigns the ownership of it to the current side.