#include "character/states/jobs/swordman/SwordmanSkill1Handler.h"
#include "SDL_log.h"
#include "character/CharacterObject.h"

namespace frostbite2D {

SwordmanSkill1Handler::SwordmanSkill1Handler()
    : SwordmanActionHandlerBase("skill_1") {
}

void SwordmanSkill1Handler::OnEnter(CharacterStateContext& context,
                                    const CharacterActionDefinition& action) {
  (void)action;
  context.owner.GetMotorMutable().StopGroundMovement();
  context.owner.PlayAnimationTag("Guard");
}

SwordmanActionUpdateResult SwordmanSkill1Handler::OnUpdate(
    CharacterStateContext& context,
    const CharacterActionDefinition& action) {
  (void)action;

  context.owner.GetMotorMutable().StopGroundMovement();


  return context.owner.IsCurrentAnimationFinished()
      ? SwordmanActionUpdateResult::Finished()
      : SwordmanActionUpdateResult::Running();
}

} // namespace frostbite2D
