Untitled

 avatar
user_8265478
plain_text
a month ago
1.6 kB
1
Indexable
Never
// Copyright https://github.com/MothCocoon/FlowGraph/graphs/contributors

#pragma once

#include "Nodes/FlowNode.h"
#include "FlowNode_ExecutionMultiGate.generated.h"

/**
 * Executes a series of pins in order,
 * example:
 * In the first iteration only triggers the first output,
 * in the second iteration triggers the second output.
 */
UCLASS(NotBlueprintable, meta = (DisplayName = "Multi Gate", Keywords = "series, loop, random"))
class FLOW_API UFlowNode_ExecutionMultiGate final : public UFlowNode
{
	GENERATED_UCLASS_BODY()
	// Executing all output pins in parallel, without order.
	UPROPERTY(EditAnywhere, Category = "MultiGate")
	bool bParallel;
	
	UPROPERTY(EditAnywhere, Category = "MultiGate")
	bool bRandom;

	// Allow executing output pins again, without triggering Reset pin
	// If set to False, every output pin can be triggered only once
	UPROPERTY(EditAnywhere, Category = "MultiGate")
	bool bLoop;
	
	
	// Allow executing output pins again in a Loop, its setted with -1 by default for executing indefinitely.
	UPROPERTY(EditAnywhere, Category = "MultiGate", meta=(EditCondition = "bLoop"))
	int32 LoopCount = -1;
	
	UPROPERTY(EditAnywhere, Category = "MultiGate")
	int32 StartIndex;

private:
	UPROPERTY(SaveGame)
	int32 NextOutput;

	UPROPERTY(SaveGame)
	TArray<bool> Completed;

public:
#if WITH_EDITOR
	virtual bool CanUserAddOutput() const override { return true; }
#endif

protected:
	virtual void ExecuteInput(const FName& PinName) override;
	virtual void Cleanup() override;

#if WITH_EDITOR
	virtual FString GetNodeDescription() const override;
#endif
};
Leave a Comment