Insider1984
Technical User
Hi there. I have a List<List<Point>> (maybe this is a bad idea but i need 2D array with speed).
The problem I have is search for points inside this array. I know that I should use a Predicate but the only example I found (interestingly enough) is from Microsoft and they are using an Array[] Points.
I think I'm very close but need help with one peice of code inside the predicate, the P coming in.... is that the point from my list of lists or is it the point that I'm trying to find on?
How do I do the comparison? Also see if their is a way below to make this easier.....
Should I use a List<Point[]> instead?
=====================
Insider
4 year 'on the fly' programmer
C, C++, C#, MFC, Basic, Java ASP.NET
The problem I have is search for points inside this array. I know that I should use a Predicate but the only example I found (interestingly enough) is from Microsoft and they are using an Array[] Points.
I think I'm very close but need help with one peice of code inside the predicate, the P coming in.... is that the point from my list of lists or is it the point that I'm trying to find on?
How do I do the comparison? Also see if their is a way below to make this easier.....
Code:
Nullable<Point> temppoint = new Nullable<Point>(new Nullable<Point>(new Point(pointX - 1, pointY)));
int temp = tempDefectBlob[tempDefectBlob.Count].Find(temppoint,PointMatch);
//later in the code:
private static bool PointMatch(Point p)
{
if (p.X == ?????? %% p.Y == ???????)
{
return true;
}
else
{
return false;
}
}
Should I use a List<Point[]> instead?
=====================
Insider
4 year 'on the fly' programmer
C, C++, C#, MFC, Basic, Java ASP.NET