private void LoopInDirection(
int terminalStepAction, int nextStepAction_Cycle, int nextStepAction_Reverse)
{
if (currentStepAction == terminalStepAction)
{
TimesLooped++;
if (LoopCount.HasValue && TimesLooped == LoopCount.Value)
{
Finished = true;
}
else
{
switch (LoopType)
{
case AnimationStateLoopType.Cycle:
currentStepAction = nextStepAction_Cycle;
break;
case AnimationStateLoopType.Reverse:
currentStepAction = nextStepAction_Reverse;
break;
default:
throw new AnimationStateLoopTypeException(
String.Format(
"Invalid LoopType encountered: '{0}'.", LoopType
)
);
}
}
}
}