visualizations

Programmatic visualizations
git clone git://git.laack.co/visualizations.git
Log | Files | Refs | README

vertex.cpp (529B)


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