2024-02-25 14:46:47 +00:00
|
|
|
#pragma once
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
#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() {}
|
|
|
|
|
2023-07-20 14:58:49 +00:00
|
|
|
virtual void update(float dt) override;
|
2023-06-20 04:33:09 +00:00
|
|
|
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;
|
|
|
|
|
2023-07-05 11:33:15 +00:00
|
|
|
Vec2F m_inSize;
|
|
|
|
Vec2F m_outSize;
|
|
|
|
Vec2F m_nodeSize;
|
2023-06-20 04:33:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|