Horizon
tool_place_junction.hpp
1 #pragma once
2 #include "core.hpp"
3 #include <forward_list>
4 
5 namespace horizon {
6 
7 class ToolPlaceJunction : public virtual ToolBase {
8 public:
9  ToolPlaceJunction(Core *c, ToolID tid);
10  ToolResponse begin(const ToolArgs &args) override;
11  ToolResponse update(const ToolArgs &args) override;
12  bool can_begin() override;
13 
14 protected:
15  Junction *temp = 0;
16  std::forward_list<Junction *> junctions_placed;
17 
18  void create_junction(const Coordi &c);
19  virtual void create_attached()
20  {
21  }
22  virtual void delete_attached()
23  {
24  }
25  virtual bool update_attached(const ToolArgs &args)
26  {
27  return false;
28  }
29  virtual bool check_line(class LineNet *li)
30  {
31  return true;
32  }
33  virtual bool begin_attached()
34  {
35  return true;
36  }
37 };
38 } // namespace horizon
horizon::LineNet
LineNet is similar to Line, except it denotes electrical connection.
Definition: line_net.hpp:24
horizon::ToolPlaceJunction::can_begin
bool can_begin() override
Definition: tool_place_junction.cpp:12
horizon::ToolPlaceJunction::update
ToolResponse update(const ToolArgs &args) override
Gets called whenever the user generated some sort of input.
Definition: tool_place_junction.cpp:38
horizon::Coord< int64_t >
horizon::Core
Where Tools and and documents meet.
Definition: core.hpp:240
horizon::ToolPlaceJunction::begin
ToolResponse begin(const ToolArgs &args) override
Gets called right after the constructor has finished.
Definition: tool_place_junction.cpp:17
horizon::Junction
A Junction is a point in 2D-Space.
Definition: junction.hpp:25
horizon::ToolPlaceJunction
Definition: tool_place_junction.hpp:7
horizon::ToolBase
Common interface for all Tools.
Definition: core.hpp:141
horizon::ToolResponse
To signal back to the core what the Tool did, a Tool returns a ToolResponse.
Definition: core.hpp:52
horizon::ToolArgs
This is what a Tool receives when the user did something.
Definition: core.hpp:26