Suppose I have a class
XYNode
{
protected int mX;
protected int mY;
}
and a queue
Queue<XyNode> testQueue = new Queue<XYNode>();
I want to check if a node with that specific x and y coordinate is already in the queue. The following obviously doesn't work :
testQueue.Contains(new XYNode(testX, testY))
because even if a node with those coordinates is in the queue, we're testing against a different XYNode object so it will always return false.
What's the right solution ?