Removed the concept of edges in favor of a proper tree-style approach, with each vertex knowing about its neighbors. This seems to have broken both Grah::crosses_edge() and Graph::remove_vertex. and the move radius circle doesn't draw any more. Go team.

This commit is contained in:
2011-06-27 18:10:24 -04:00
parent ed0d8c5e26
commit 07fc8c67c1
5 changed files with 53 additions and 120 deletions

View File

@ -134,7 +134,7 @@ float GameData::calculate_strength(Vertex* node)
float GameData::calculate_strength_r(Vertex* node, unsigned int depth, list<Vertex*>& visited)
{
// Find which vertices we need to visit from here
list<Vertex*> neighbors = get_neighbors(node);
list<Vertex*> neighbors = node->neighbors;
list<Vertex*> to_visit;
visited.push_back(node);
@ -184,7 +184,7 @@ int GameData::get_range(Vertex* node)
else if (mode == MODE_ATTACK)
{
int range = 200;
list<Vertex*> neighbors = get_neighbors(node);
list<Vertex*> neighbors = node->neighbors;
for(list<Vertex*>::iterator cursor = neighbors.begin();
cursor != neighbors.end(); cursor++)