#pragma once

#include "CoreMinimal.h"
#include "AnimLayerUpdateInterface.h"
#include "BaseSurvivorAnimInstance.h"
#include "K25ChainAnchorAnimationData.h"
#include "EK25ChainAnchorPointDirection.h"
#include "EK25ChainDetachmentReason.h"
#include "K25ChainLocomotionSurvivorAnimInstance.generated.h"

class AK25Chain;
class AK25SurvivorChainAttachmentAnchor;

UCLASS(Blueprintable, NonTransient)
class UK25ChainLocomotionSurvivorAnimInstance : public UBaseSurvivorAnimInstance, public IAnimLayerUpdateInterface
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	bool _hasChainsAttached;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	bool _isPerformingBreakChainInteraction;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	float _forwardDirectionDotProductResult;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	float _lateralDirectionDotProductResult;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	AK25Chain* _currentChainBeingDetached;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	FK25ChainAnchorAnimationData _leftHandAttachmentData;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	FK25ChainAnchorAnimationData _rightHandAttachmentData;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	FK25ChainAnchorAnimationData _leftShoulderAttachmentData;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	FK25ChainAnchorAnimationData _rightShoulderAttachmentData;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	FK25ChainAnchorAnimationData _stomachAttachmentData;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	FK25ChainAnchorAnimationData _backAttachmentData;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	EK25ChainAnchorPointDirection _chainDirection;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	bool _hasBrokenFreeFromChain;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	float _hasBrokenFreeTime;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	bool _hasBeenHitByChain;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	bool _isIdle;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	bool _IsCrouched;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	bool _isMale;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	bool _isBeingCarried;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	float _hasBeenHitByChainTime;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	FName _hitChainName;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	FName _detachedChainAnchorName;

protected:
	UFUNCTION(BlueprintCallable)
	void OnChainDetached(AK25Chain* chain, AK25SurvivorChainAttachmentAnchor* chainAttachmentAnchor, EK25ChainDetachmentReason detachmentReason);

	UFUNCTION(BlueprintCallable)
	void OnChainAttached(AK25Chain* chain, AK25SurvivorChainAttachmentAnchor* chainAttachmentAnchor);

public:
	UK25ChainLocomotionSurvivorAnimInstance();
};

FORCEINLINE uint32 GetTypeHash(const UK25ChainLocomotionSurvivorAnimInstance) { return 0; }
