Horizon
src
core
tools
tool_draw_track.hpp
1
#pragma once
2
#include "board/track.hpp"
3
#include "core/tool.hpp"
4
5
namespace
horizon {
6
7
class
ToolDrawTrack :
public
ToolBase {
8
public
:
9
ToolDrawTrack(IDocument *c, ToolID tid);
10
ToolResponse
begin
(
const
ToolArgs
&args)
override
;
11
ToolResponse
update
(
const
ToolArgs
&args)
override
;
12
bool
can_begin
()
override
;
13
std::set<InToolActionID> get_actions()
const override
14
{
15
using
I = InToolActionID;
16
return
{
17
I::LMB,
18
I::CANCEL,
19
I::RMB,
20
};
21
}
22
23
private
:
24
Junction *temp_junc = 0;
25
Track *temp_track = 0;
26
Track *create_temp_track();
27
class
BoardRules *rules;
28
};
29
}
// namespace horizon
horizon::ToolDrawTrack::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
horizon::ToolDrawTrack::can_begin
bool can_begin() override
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition:
tool.hpp:42
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition:
tool.hpp:23
horizon::ToolDrawTrack::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Generated by
1.8.20