Artemis.Engine.Graphics.AnimationState.LoopInDirection C# (CSharp) Method

LoopInDirection() private method

private LoopInDirection ( int terminalStepAction, int nextStepAction_Cycle, int nextStepAction_Reverse ) : void
terminalStepAction int
nextStepAction_Cycle int
nextStepAction_Reverse int
return void
        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
                                    )
                                );
                    }
                }
            }
        }