2024-10-09 02:01:23 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2024-10-13 04:22:09 +02:00
|
|
|
#include <raylib.h>
|
|
|
|
|
|
2024-10-09 02:01:23 +02:00
|
|
|
#include "datatypes.h"
|
|
|
|
|
#include "moveable.h"
|
2024-10-13 04:22:09 +02:00
|
|
|
#include "node.h"
|
2024-10-09 02:01:23 +02:00
|
|
|
|
|
|
|
|
class Signal : public Movable{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
Signal();
|
2024-10-13 04:22:09 +02:00
|
|
|
Signal(float x, float y, float r, float s) : Movable(Vec2D<float>(x, y), Vec2D<float>(0,0), s), radius(r) {}
|
2024-10-09 02:01:23 +02:00
|
|
|
|
|
|
|
|
int id = 0;
|
2024-10-13 04:22:09 +02:00
|
|
|
|
|
|
|
|
Node *next;
|
2024-10-16 02:26:02 +02:00
|
|
|
Node *last;
|
2024-10-13 04:22:09 +02:00
|
|
|
|
|
|
|
|
bool at_target = false;
|
2024-10-09 02:01:23 +02:00
|
|
|
int target_node_id = 1;
|
|
|
|
|
int source_node_id = 0;
|
|
|
|
|
|
|
|
|
|
float radius;
|
|
|
|
|
|
2024-10-20 23:42:38 +02:00
|
|
|
void draw(Vec2D<float> *mouse, Camera2D *cam) {
|
2024-10-13 04:22:09 +02:00
|
|
|
|
|
|
|
|
position += direction.norm() * speed;
|
|
|
|
|
|
|
|
|
|
DrawCircle(position.x, position.y, radius, (Color){232, 125, 62, 255});
|
2024-10-09 02:01:23 +02:00
|
|
|
|
2024-10-13 04:22:09 +02:00
|
|
|
}
|
2024-10-09 02:01:23 +02:00
|
|
|
};
|