Added support to get the start of an extent from any item in them.

This commit is contained in:
2017-09-21 18:31:17 +01:00
parent 3181112e7a
commit 90a39696ff
8 changed files with 112 additions and 0 deletions

View File

@@ -201,5 +201,19 @@ namespace Extents
{
return backend.ToArray();
}
public bool GetStart(int item, out int start)
{
start = 0;
foreach(Tuple<int, int> extent in backend)
{
if(item >= extent.Item1 && item <= extent.Item2)
{
start = extent.Item1;
return true;
}
}
return false;
}
}
}