/[projectaxis]/projectaxis/projectAxis/src/map/pathfinding/mapsearch.cpp
ViewVC logotype

Diff of /projectaxis/projectAxis/src/map/pathfinding/mapsearch.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by leiavoia, Fri Jul 25 21:18:38 2003 UTC revision 1.4 by leiavoia, Fri Aug 8 02:09:39 2003 UTC
# Line 79  bool MapSearchNode::GetSuccessors( AStar Line 79  bool MapSearchNode::GetSuccessors( AStar
79          MapSearchNode NewNode;          MapSearchNode NewNode;
80    
81          // push each possible move except allowing the search to go backwards          // push each possible move except allowing the search to go backwards
82          if( themap->IsValid(x-1, y) && (themap->GetObst(x-1, y) != 1)  &&  !((parent_x == x-1) && (parent_y == y))  ) {          if( themap->IsValid(x-1, y) && (themap->GetObst(x-1, y) != OBST_BLOCK)  &&  !((parent_x == x-1) && (parent_y == y))  ) {
83                  NewNode = MapSearchNode( x-1, y );                  NewNode = MapSearchNode( x-1, y );
84                  astarsearch->AddSuccessor( NewNode );                  astarsearch->AddSuccessor( NewNode );
85                  }                  }
86    
87          if( themap->IsValid(x, y-1) && (themap->GetObst(x, y-1) != 1)  &&  !((parent_x == x) && (parent_y == y-1))  ) {          if( themap->IsValid(x, y-1) && (themap->GetObst(x, y-1) != OBST_BLOCK)  &&  !((parent_x == x) && (parent_y == y-1))  ) {
88                  NewNode = MapSearchNode( x, y-1 );                  NewNode = MapSearchNode( x, y-1 );
89                  astarsearch->AddSuccessor( NewNode );                  astarsearch->AddSuccessor( NewNode );
90                  }                  }
91    
92          if( themap->IsValid(x+1, y) && (themap->GetObst(x+1, y) != 1)  &&  !((parent_x == x+1) && (parent_y == y))  ) {          if( themap->IsValid(x+1, y) && (themap->GetObst(x+1, y) != OBST_BLOCK)  &&  !((parent_x == x+1) && (parent_y == y))  ) {
93                  NewNode = MapSearchNode( x+1, y );                  NewNode = MapSearchNode( x+1, y );
94                  astarsearch->AddSuccessor( NewNode );                  astarsearch->AddSuccessor( NewNode );
95                  }                  }
96    
97          if( themap->IsValid(x, y+1) && (themap->GetObst(x, y+1) != 1)  &&  !((parent_x == x) && (parent_y == y+1))  ) {          if( themap->IsValid(x, y+1) && (themap->GetObst(x, y+1) != OBST_BLOCK)  &&  !((parent_x == x) && (parent_y == y+1))  ) {
98                  NewNode = MapSearchNode( x, y+1 );                  NewNode = MapSearchNode( x, y+1 );
99                  astarsearch->AddSuccessor( NewNode );                  astarsearch->AddSuccessor( NewNode );
100                  }                  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26