Skip to content

Instantly share code, notes, and snippets.

@DanielWJudge
Created August 25, 2014 15:44
Show Gist options
  • Save DanielWJudge/a1a7bc94a7c8191e02f6 to your computer and use it in GitHub Desktop.
Save DanielWJudge/a1a7bc94a7c8191e02f6 to your computer and use it in GitHub Desktop.
Time Period Final
if (isTypeA)
{
periodsToCheck.AddAll(typeAPeriods);
if (isTypeB)
{
//find overlaps between type a and type b
periodsToCheck.AddAll(typeBPeriods);
overlapPeriods = periodCombiner.IntersectPeriods(periodsToCheck);
//reassign periods to check to the overlapping periods if we have to look at type C
periodsToCheck = (TimePeriodCollection) overlapPeriods;
}
if (isTypeC)
{
//find overlaps between type a (and possibly type b)
periodsToCheck.AddAll(typeCPeriods);
overlapPeriods = periodCombiner.IntersectPeriods(periodsToCheck);
}
}
else
{
//find overlaps for just type B and type C
periodsToCheck.AddAll(typeBPeriods);
periodsToCheck.AddAll(typeCPeriods);
overlapPeriods = periodCombiner.IntersectPeriods(periodsToCheck);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment