Major refactoring - moved constants around, made graph class more graphy, put things where they belong. Simplified a lot of code that I wrote when I wasn't thinking clearly, apparently.

This commit is contained in:
2011-06-23 12:36:40 -04:00
parent 54b46d77d2
commit d76fc8099e
4 changed files with 30 additions and 59 deletions

15
graph.h
View File

@ -14,15 +14,12 @@ using std::list;
class Vertex
{
public:
Vertex(int x, int y)
Vertex(int x, int y, int r)
{ this->x = x; this->y = y; }
int x;
int y;
int x_min;
int y_min;
int x_max;
int y_max;
int r;
};
struct Edge
@ -42,14 +39,12 @@ class Graph
list<Vertex*> get_vertices() { return vertices; }
list<Edge> get_edges() { return edges; }
void do_vertex(int x, int y, int size);
void select_vertex(int x, int y);
void do_vertex(int x, int y, int r);
Vertex* get_current_vertex() { return current_vertex; }
static int MAX_MOVE_DISTANCE;
private:
void add_vertex(int x, int y, int size);
void select_vertex(int x, int y);
void add_vertex(int x, int y, int r);
Vertex* current_vertex;
list<Vertex*> vertices;