// ©2023 Batty Bovine Productions, LLC. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "UObject/Object.h"

#include "ComboActionGraphLayoutStrategy.generated.h"


/**
 * 
 */
UCLASS(Abstract)
class COMBOINPUTEDITOR_API UComboActionGraphLayoutStrategy : public UObject
{
	GENERATED_BODY()
	
public:
	UComboActionGraphLayoutStrategy();

	virtual void Layout(UEdGraph *G) {};

	UComboActionGraphEditorSettings *Settings;

protected:
	int32 GetNodeWidth(UEdComboActionGraphNode *EdNode);

	int32 GetNodeHeight(UEdComboActionGraphNode *EdNode);

	FBox2D GetNodeBound(UEdGraphNode *EdNode);

	FBox2D GetActualBounds(UComboActionGraphNode *RootNode);

	virtual void RandomLayoutOneTree(UComboActionGraphNode *RootNode, const FBox2D &Bound);

protected:
	UComboActionGraph *Graph;
	UEdComboActionGraph *EdGraph;
	int32 MaxIteration;
	int32 OptimalDistance;
};
