35 lines
626 B
C++
35 lines
626 B
C++
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <SFML/Graphics.hpp>
|
||
|
|
#include <SFML/Graphics/RenderWindow.hpp>
|
||
|
|
|
||
|
|
#include "datatypes.h"
|
||
|
|
#include "moveable.h"
|
||
|
|
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
class Node : public Movable{
|
||
|
|
|
||
|
|
public:
|
||
|
|
Node() {}
|
||
|
|
Node(float x, float y, float r) : Movable(Vec2D<float>(x, y), 0.0f), radius(r) {}
|
||
|
|
|
||
|
|
float radius;
|
||
|
|
|
||
|
|
bool clicked = false;
|
||
|
|
bool hover_move = false;
|
||
|
|
bool hover_connect = false;
|
||
|
|
|
||
|
|
std::vector<Node*> connections;
|
||
|
|
|
||
|
|
void update() {};
|
||
|
|
|
||
|
|
void draw(sf::RenderWindow* window) {
|
||
|
|
|
||
|
|
sf::CircleShape circle(radius);
|
||
|
|
circle.setFillColor(sf::Color::Green);
|
||
|
|
circle.setPosition(position.x, position.y);
|
||
|
|
window->draw(circle);
|
||
|
|
}
|
||
|
|
};
|