Horizon
Loading...
Searching...
No Matches
tool_resize_symbol.hpp
1#pragma once
2#include "core/tool.hpp"
3
4namespace horizon {
5
6class ToolResizeSymbol : public ToolBase {
7public:
8 using ToolBase::ToolBase;
9 ToolResponse begin(const ToolArgs &args) override;
10 ToolResponse update(const ToolArgs &args) override;
11 bool can_begin() override;
12 std::set<InToolActionID> get_actions() const override
13 {
14 using I = InToolActionID;
15 return {
16 I::LMB, I::CANCEL, I::RMB, I::MOVE_UP, I::MOVE_DOWN, I::MOVE_LEFT, I::MOVE_RIGHT,
17 };
18 }
19
20
21private:
22 Coordi pos_orig;
23 Coordi delta_key;
24 std::map<std::pair<ObjectType, UUID>, Coordi> positions;
25
26 void update_positions(const Coordi &ac);
27};
28} // namespace horizon
This is what a Tool receives when the user did something.
Definition tool_pub.hpp:23
Common interface for all Tools.
Definition tool_pub.hpp:94
Definition tool_resize_symbol.hpp:6
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition tool_resize_symbol.cpp:16
bool can_begin() override
Definition tool_resize_symbol.cpp:11
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition tool_resize_symbol.cpp:99
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition tool_pub.hpp:40