#include "character/states/CharacterStateRegistry.h"
#include "character/CharacterStateMachine.h"
#include "character/states/common/DeadState.h"
#include "character/states/common/FallState.h"
#include "character/states/common/HurtState.h"
#include "character/states/common/IdleState.h"
#include "character/states/common/JumpState.h"
#include "character/states/common/LandingState.h"
#include "character/states/common/MoveState.h"
#include "character/states/jobs/swordman/SwordmanAttackState.h"
#include <memory>

namespace frostbite2D {

void RegisterCommonCharacterStates(CharacterStateMachine& machine) {
  machine.RegisterState(std::make_unique<IdleState>());
  machine.RegisterState(std::make_unique<MoveState>());
  machine.RegisterState(std::make_unique<JumpState>());
  machine.RegisterState(std::make_unique<FallState>());
  machine.RegisterState(std::make_unique<LandingState>());
  machine.RegisterState(std::make_unique<HurtState>());
  machine.RegisterState(std::make_unique<DeadState>());
}

void RegisterJobCharacterStates(CharacterStateMachine& machine,
                                const character::CharacterConfig& config) {
  if (config.jobTag == "swordman") {
    machine.RegisterState(std::make_unique<SwordmanAttackState>());
  }
}

} // namespace frostbite2D
