~widelands-dev/widelands/bug-1234725-port-buildhelp

« back to all changes in this revision

Viewing changes to src/editor/tools/decrease_height_tool.h

  • Committer: GunChleoc
  • Date: 2017-03-23 06:41:13 UTC
  • mfrom: (8008.1.317 trunk)
  • Revision ID: fios@foramnagaidhlig.net-20170323064113-o95ueumg4j1u6qt7
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2002-2004, 2006-2008, 2012 by the Widelands Development Team
 
2
 * Copyright (C) 2002-2017 by the Widelands Development Team
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or
5
5
 * modify it under the terms of the GNU General Public License
24
24
 
25
25
///  Decreases the height of a node by a value.
26
26
struct EditorDecreaseHeightTool : public EditorTool {
27
 
        EditorDecreaseHeightTool() : EditorTool(*this, *this), change_by_(1) {}
28
 
 
29
 
        int32_t handle_click_impl
30
 
                (const Widelands::World& world,
31
 
                 Widelands::NodeAndTriangle<> center,
32
 
                 EditorInteractive & parent,
33
 
                 EditorActionArgs* args,
34
 
                 Widelands::Map* map) override;
35
 
 
36
 
        int32_t handle_undo_impl
37
 
                (const Widelands::World& world,
38
 
                 Widelands::NodeAndTriangle<> center,
39
 
                 EditorInteractive& parent,
40
 
                 EditorActionArgs* args,
41
 
                 Widelands::Map* map) override;
42
 
 
43
 
        EditorActionArgs format_args_impl(EditorInteractive & parent) override;
44
 
 
45
 
        char const * get_sel_impl() const override {
46
 
                return "images/wui/editor//fsel_editor_decrease_height.png";
47
 
        }
48
 
 
49
 
        int32_t get_change_by() const {return change_by_;}
50
 
        void set_change_by(const int32_t n) {change_by_ = n;}
 
27
        EditorDecreaseHeightTool() : EditorTool(*this, *this), change_by_(1) {
 
28
        }
 
29
 
 
30
        int32_t handle_click_impl(const Widelands::World& world,
 
31
                                  const Widelands::NodeAndTriangle<>& center,
 
32
                                  EditorInteractive& parent,
 
33
                                  EditorActionArgs* args,
 
34
                                  Widelands::Map* map) override;
 
35
 
 
36
        int32_t handle_undo_impl(const Widelands::World& world,
 
37
                                 const Widelands::NodeAndTriangle<>& center,
 
38
                                 EditorInteractive& parent,
 
39
                                 EditorActionArgs* args,
 
40
                                 Widelands::Map* map) override;
 
41
 
 
42
        EditorActionArgs format_args_impl(EditorInteractive& parent) override;
 
43
 
 
44
        const Image* get_sel_impl() const override {
 
45
                return g_gr->images().get("images/wui/editor//fsel_editor_decrease_height.png");
 
46
        }
 
47
 
 
48
        int32_t get_change_by() const {
 
49
                return change_by_;
 
50
        }
 
51
        void set_change_by(const int32_t n) {
 
52
                change_by_ = n;
 
53
        }
51
54
 
52
55
private:
53
56
        int32_t change_by_;