vertex.cpp (633B)
1 #include "../include/vertex.hpp" 2 3 #include <raylib.h> 4 5 #include <string> 6 7 Vertex::Vertex(Vector2 position, float drawSize) 8 : position(position), drawSize(drawSize) {} 9 10 std::string Vertex::toString() { 11 std::string result = "(x: " + std::to_string(this->position.x) + 12 ", y: " + std::to_string(this->position.y) + 13 ", visited: " + std::to_string(this->visited) + ")"; 14 return result; 15 } 16 17 void Vertex::render() { 18 if (visited) { 19 DrawCircle(position.x, position.y, drawSize, WHITE); 20 } else { 21 DrawCircle(position.x, position.y, drawSize, DARKGRAY); 22 } 23 }