private void checkSteadiness(Rectangle[] rectangles)
{
if (lastObjects == null ||
rectangles == null ||
rectangles.Length == 0)
{
Steady = 0;
return;
}
bool equals = true;
foreach (Rectangle current in rectangles)
{
bool found = false;
foreach (Rectangle last in lastObjects)
{
if (current.IsEqual(last, steadyThreshold))
{
found = true;
continue;
}
}
if (!found)
{
equals = false;
break;
}
}
if (equals)
Steady++;
else
Steady = 0;
}