I have this code
Class location
{
int X{Get; Set;}
int Y{Get;Set;}
}
List<location> mylst = new List<location>();
Public Void SetupList()
{
for(int i =0; i<8; i++)
{
for(int b=0; b<8; b++)
{
location loc = new location();
loc.x = b;
loc.y = i;
mylst.Add(loc);
}
}
}
Once the list is populated i want to be able to search through the list and see if any of the items in the list contain a location i.e
/// lets search for location 4,4
location tofind = new location()
tofind.x=4;
tofind.y=4;
foreach(location loc in mylst)
{
if(loc == tofind)
{
///delete that item from the list
}
}
but i am at a total loss on how to do this...
Any ideas would be helpful as nothing i have tried has worked