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:
15
graph.h
15
graph.h
@ -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;
|
||||
|
Reference in New Issue
Block a user