conversion to smart pointers done but still buggy

This commit is contained in:
Sebastian
2024-11-01 02:38:47 +01:00
parent c0eb7c98ba
commit 19b2c9549f
15 changed files with 389 additions and 524 deletions
+8 -9
View File
@@ -1,26 +1,25 @@
#pragma once
#include <memory>
#include <raylib.h>
#include "datatypes.h"
#include "moveable.h"
#include "node.h"
class Signal : public Movable{
public:
Signal();
Signal(float x, float y, float r, float _speed, Color color) : Movable(Vec2D<float>(x, y), Vec2D<float>(0,0), _speed), radius(r), color(color) {}
Signal(Vec2D<float> position, float r, float _speed, Color color) : Movable(position, Vec2D<float>(0,0), _speed), radius(r), color(color) {}
int id = 0;
std::shared_ptr<Node> next;
std::shared_ptr<Node> last;
std::shared_ptr<Edge> edge;
int next;
int last;
int start;
std::shared_ptr<Node> start;
bool at_target = false;
int target_node_id = 1;
int source_node_id = 0;
float radius;
@@ -35,7 +34,7 @@ class Signal : public Movable{
position += direction.norm() * speed * multiplier * (float)t_delta / 1000000.0f;
}
void draw(Vec2D<float> *mouse, Camera2D *cam) {
void draw(Vec2D<float> mouse, Camera2D cam) {
DrawCircle(position.x, position.y, radius, color);
}
};