diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
commit | 6352e8e3196f78388b6c771073f9e03eaa612673 (patch) | |
tree | e23772f79a7fbc41bc9108951e9e136857484bf4 /source/frontend/StarWireInterface.hpp | |
parent | 6741a057e5639280d85d0f88ba26f000baa58f61 (diff) |
everything everywhere
all at once
Diffstat (limited to 'source/frontend/StarWireInterface.hpp')
-rw-r--r-- | source/frontend/StarWireInterface.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/source/frontend/StarWireInterface.hpp b/source/frontend/StarWireInterface.hpp new file mode 100644 index 0000000..8e4474f --- /dev/null +++ b/source/frontend/StarWireInterface.hpp @@ -0,0 +1,48 @@ +#ifndef STAR_WIRE_INTERFACE_HPP +#define STAR_WIRE_INTERFACE_HPP + +#include "StarPane.hpp" +#include "StarWiring.hpp" + +namespace Star { + +STAR_CLASS(WorldClient); +STAR_CLASS(WorldPainter); +STAR_CLASS(Player); +STAR_CLASS(WirePane); + +class WirePane : public Pane, public WireConnector { +public: + WirePane(WorldClientPtr worldClient, PlayerPtr player, WorldPainterPtr worldPainter); + virtual ~WirePane() {} + + virtual void update() override; + virtual bool sendEvent(InputEvent const& event) override; + + virtual SwingResult swing(WorldGeometry const& geometry, Vec2F position, FireMode mode) override; + virtual bool connecting() override; + + virtual void reset(); + +protected: + void renderImpl() override; + +private: + void renderWire(Vec2F from, Vec2F to, Color baseColor); + + WorldClientPtr m_worldClient; + PlayerPtr m_player; + WorldPainterPtr m_worldPainter; + Vec2I m_mousePos; + bool m_connecting; + WireDirection m_sourceDirection; + WireConnection m_sourceConnector; + + Vec2F m_insize; + Vec2F m_outsize; + Vec2F m_nodesize; +}; + +} + +#endif |