Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 27 Nov 2011
Offline Last Active Jun 06 2013 11:06 AM

Posts I've Made

In Topic: std::vector issues

14 February 2013 - 08:13 AM

So I fixed my operator=, which fixed the rest. Here's my new function:


Node Node::operator=(Node copy)
    this->pos.x = copy.pos.x;
    this->pos.y = copy.pos.y;
    this->parent = copy.parent;
    this->g = copy.g;
    return *this;


Thanks for all the help

In Topic: std::vector issues

13 February 2013 - 12:59 PM

It seems like that operator= isn't working, so I'll fix it and try to get it to work.

In Topic: std::vector issues

13 February 2013 - 12:31 PM

This is the first time I've actually ever used operator overloading before. I didn't really kow what I was doing. Here's the function:


Node Node::operator=(Node copy)
    return copy;

In Topic: Application Name and Icon Help

12 February 2013 - 07:46 PM

Have you tried setting a custom name and title in glut? http://www.opengl.org/resources/libraries/glut/spec3/node27.html

In Topic: std::vector issues

12 February 2013 - 07:25 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);