Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#ActualCaptacha

Posted 12 February 2013 - 07:27 PM

Yes, it does. openList is passed as vector<Node>& openList. Here's the general algorithm for it. The functions in the if statement's body don't affect either list.

 

 

Node* tmp;
if(!hasWall(parentNode.pos.x, parentNode.pos.y-1, wallCords) && !onClosedList(Position(parentNode.pos.x, parentNode.pos.y-1), closedList))
{
    tmp = new Node(Position(parentNode.pos.x, parentNode.pos.y-1), &parentNode);
    openList.push_back(*tmp);
}

 


#4Captacha

Posted 12 February 2013 - 07:27 PM

Yes, it does. openList is passed as vector<Node>& openList. Here's the general algorithim for it. The functions in the if statement's body don't affect either list.

 

 

Node* tmp;
if(!hasWall(parentNode.pos.x, parentNode.pos.y-1, wallCords) && !onClosedList(Position(parentNode.pos.x, parentNode.pos.y-1), closedList))
{
    tmp = new Node(Position(parentNode.pos.x, parentNode.pos.y-1), &parentNode);
    openList.push_back(*tmp);
}

 


#3Captacha

Posted 12 February 2013 - 07:26 PM

Yes, it does. openList is passed as vector<Node>& openList. Here's a sample. The functions in the if statement's body don't affect either list.

 

 

Node* tmp;
if(!hasWall(parentNode.pos.x, parentNode.pos.y-1, wallCords) && !onClosedList(Position(parentNode.pos.x, parentNode.pos.y-1), closedList))
{
    tmp = new Node(Position(parentNode.pos.x, parentNode.pos.y-1), &parentNode);
    openList.push_back(*tmp);
}

 


#2Captacha

Posted 12 February 2013 - 07:25 PM

Yes, it does. openList is passed as vector<Node>& openList. Here's a sample. The functions in the if statement's body don't affect either list.

Node* 
tmp;if(!hasWall(parentNode.pos.x, 
parentNode.pos.y-1, wallCords) && !onClosedList(Position(parentNode.pos.x, 
parentNode.pos.y-1), closedList)){tmp = new Node(Position(parentNode.pos.x, 
parentNode.pos.y-1), &parentNode);openList.push_back(*tmp);}
 

#1Captacha

Posted 12 February 2013 - 07:25 PM

Yes, it does. openList is passed as vector<Node>& openList. Here's a sample. The functions in the if statement's body don't affect either list.

Node* 
tmp;if(!hasWall(parentNode.pos.x, 
parentNode.pos.y-1, wallCords) && !onClosedList(Position(parentNode.pos.x, 
parentNode.pos.y-1), closedList)){tmp = new Node(Position(parentNode.pos.x, 
parentNode.pos.y-1), &parentNode);openList.push_back(*tmp);}
 

PARTNERS