play method

void play(
  1. SimpleAnimationEnum animation
)

Method used to play specific default animation

Implementation

void play(SimpleAnimationEnum animation) {
  _currentType = animation;
  if (!runToTheEndFastAnimation) {
    _fastAnimation = null;
  }
  switch (animation) {
    case SimpleAnimationEnum.idleLeft:
      _current = idleLeft;
      break;
    case SimpleAnimationEnum.idleRight:
      _current = idleRight;
      break;
    case SimpleAnimationEnum.idleUp:
      if (idleUp != null) _current = idleUp;
      break;
    case SimpleAnimationEnum.idleDown:
      if (idleDown != null) _current = idleDown;
      break;
    case SimpleAnimationEnum.idleTopLeft:
      if (idleUpLeft != null) _current = idleUpLeft;
      break;
    case SimpleAnimationEnum.idleTopRight:
      if (idleUpRight != null) _current = idleUpRight;
      break;
    case SimpleAnimationEnum.idleDownLeft:
      if (idleDownLeft != null) _current = idleDownLeft;
      break;
    case SimpleAnimationEnum.idleDownRight:
      if (idleDownRight != null) _current = idleDownRight;
      break;
    case SimpleAnimationEnum.runUp:
      if (runUp != null) _current = runUp;
      break;
    case SimpleAnimationEnum.runRight:
      _current = runRight;
      break;
    case SimpleAnimationEnum.runDown:
      if (runDown != null) _current = runDown;
      break;
    case SimpleAnimationEnum.runLeft:
      _current = runLeft;
      break;
    case SimpleAnimationEnum.runUpLeft:
      if (runUpLeft != null) _current = runUpLeft;
      break;
    case SimpleAnimationEnum.runUpRight:
      if (runUpRight != null) _current = runUpRight;
      break;
    case SimpleAnimationEnum.runDownLeft:
      if (runDownLeft != null) _current = runDownLeft;
      break;
    case SimpleAnimationEnum.runDownRight:
      if (runDownRight != null) _current = runDownRight;
      break;
    case SimpleAnimationEnum.custom:
      break;
  }
}