text: // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
  
  #pragma once
  
  #include "K2Node.h"
  #include "EdGraph/EdGraphNodeUtils.h" // for FNodeTextCache
  #include "K2Node_ConstructObjectFromClass.generated.h"
  
  UCLASS(abstract)
  class BLUEPRINTGRAPH_API UK2Node_ConstructObjectFromClass : public UK2Node
  {
  	GENERATED_UCLASS_BODY()
  
  	// Begin UEdGraphNode interface.
  	virtual void AllocateDefaultPins() override;
  	virtual FLinearColor GetNodeTitleColor() const override;
  	virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
  	virtual void PinDefaultValueChanged(UEdGraphPin* Pin) override;
  	virtual FText GetTooltipText() const override;
  	virtual bool HasExternalDependencies(TArray<class UStruct*>* OptionalOutput) const override;
  	virtual bool IsCompatibleWithGraph(const UEdGraph* TargetGraph) const override;
  	virtual void PinConnectionListChanged(UEdGraphPin* Pin);
  	// End UEdGraphNode interface.
  
  	// Begin UK2Node interface
  	virtual bool IsNodeSafeToIgnore() const override { return true; }
  	virtual void ReallocatePinsDuringReconstruction(TArray<UEdGraphPin*>& OldPins) override;
  	virtual void GetNodeAttributes( TArray<TKeyValuePair<FString, FString>>& OutNodeAttributes ) const override;
  	virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
  	virtual FText GetMenuCategory() const override;
  	// End UK2Node interface
  
  	/** Create new pins to show properties on archetype */
  	void CreatePinsForClass(UClass* InClass, TArray<UEdGraphPin*>* OutClassPins = nullptr);
  
  	/** See if this is a spawn variable pin, or a 'default' pin */
  	virtual bool IsSpawnVarPin(UEdGraphPin* Pin);
  
  	/** Get the then output pin */
  	UEdGraphPin* GetThenPin() const;
  	/** Get the blueprint input pin */	
  	UEdGraphPin* GetClassPin(const TArray<UEdGraphPin*>* InPinsToSearch=NULL) const;
  	/** Get the world context input pin, can return NULL */
  	UEdGraphPin* GetWorldContextPin() const;
  	/** Get the result output pin */
  	UEdGraphPin* GetResultPin() const;
  	/** Get the result input pin */
  	UEdGraphPin* GetOuterPin() const;
  
  	/** Get the class that we are going to spawn, if it's defined as default value */
  	UClass* GetClassToSpawn(const TArray<UEdGraphPin*>* InPinsToSearch=NULL) const;
  
  	/** Returns if the node uses World Object Context input */
  	virtual bool UseWorldContext() const;
  
  	/** Returns if the node uses Outer input */
  	virtual bool UseOuter() const { return false; }
  
  protected:
  	/** Gets the default node title when no class is selected */
  	virtual FText GetBaseNodeTitle() const;
  	/** Gets the node title when a class has been selected. */
  	virtual FText GetNodeTitleFormat() const;
  	/** Gets base class to use for the 'class' pin.  UObject by default. */
  	virtual UClass* GetClassPinBaseClass() const;
  
  	/**
  	 * Takes the specified "MutatablePin" and sets its 'PinToolTip' field (according
  	 * to the specified description)
  	 * 
  	 * @param   MutatablePin	The pin you want to set tool-tip text on
  	 * @param   PinDescription	A string describing the pin's purpose
  	 */
  	void SetPinToolTip(UEdGraphPin& MutatablePin, const FText& PinDescription) const;
  
  	/** Refresh pins when class was changed */
  	void OnClassPinChanged();
  
  	/** Tooltip text for this node. */
  	FText NodeTooltip;
  
  private:
  	/** Constructing FText strings can be costly, so we cache the node's title */
  	FNodeTextCache CachedNodeTitle;
  };
  