Most of the attack functionality now in place, but it's not all quite working yet

This commit is contained in:
2011-06-24 14:59:18 -04:00
parent e51a328641
commit 6aedad51e5
4 changed files with 142 additions and 23 deletions

12
graph.h
View File

@ -33,11 +33,18 @@ class Vertex
int score;
};
struct Edge
class Edge
{
public:
Edge();
Edge(Vertex* a, Vertex* b, int score = 0);
Vertex* a;
Vertex* b;
int score;
bool operator==(const Edge e) const;
bool operator!=(const Edge e) const { return !(*this == e); }
};
class Graph
@ -52,10 +59,11 @@ class Graph
list<Edge> get_edges(Vertex* v);
list<Vertex*> get_neighbors(Vertex* v);
bool point_in_vertex(int x, int y, int size);
bool point_in_vertex(int x, int y);
Vertex * vertex_at(int x, int y);
virtual bool add_vertex(int x, int y, int r, int colour = 0, int score = 0,
Vertex* src=NULL);
void remove_vertex(Vertex* target);
bool is_planar() const { return planar; }
void set_planar(bool planar) { this->planar = planar; }