x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Only certain Custom Structs require "==" operator for TArray to work?

 USTRUCT(BlueprintType)
 struct FPaperSkeletonSkinData
 {
     GENERATED_USTRUCT_BODY()
 
     UPROPERTY(EditAnywhere, BlueprintReadOnly)
     FName SlotName;
 
     UPROPERTY(EditAnywhere, BlueprintReadOnly)
     FName NonSpecificName;
 
     class UPaperSkeletonAttachment* Attachment;
 
     FPaperSkeletonSkinData(){}
 
     FPaperSkeletonSkinData(FName slotName, FName nonSpecificName, class UPaperSkeletonAttachment* attachment)
         : SlotName(slotName), NonSpecificName(nonSpecificName), Attachment(attachment)
     {
     }
 
     bool operator==(const FPaperSkeletonSkinData& rightSkin) const;
 };



 UPROPERTY(EditAnywhere, BlueprintReadOnly)
 TArray<FPaperSkeletonSkinData> Attachments;


This is the Custom Struct that required a "==" operator be set, so that TArray's.Find function could work properally. My question is, why does this Custom Struct require that, when this other Custom Struct, which im storing in a TArray aswell, doesnt.


 USTRUCT(BlueprintType)
 struct FPaperSkeletonAnimationData
 {
     GENERATED_USTRUCT_BODY()
 
     // Skeleton Data (Owner)
     class UPaperSkeletonData* Owner;
 
     // Name of the Animation
     UPROPERTY(EditAnywhere)
     FName AnimationName;
 
     // Duration of the Animation
     UPROPERTY(EditAnywhere)
     float Duration;
 
     // Should the animation loop?
     UPROPERTY(EditAnywhere)
     bool bShouldLoop;
 
     // Timelines/Objects relative to the Animation
     UPROPERTY(EditAnywhere)
     TArray<FPaperSkeletonTimelineData> Timelines;
 
     FPaperSkeletonAnimationData(){}
 
     FPaperSkeletonAnimationData(class UPaperSkeletonData* owner, FName animationName, float duration, bool shouldLoop, TArray<FPaperSkeletonTimelineData> timelines)
         : Owner(owner), AnimationName(animationName), Duration(duration), bShouldLoop(shouldLoop), Timelines(timelines)
     {
     }
 
     FPaperSkeletonTimelineData* FindTimeline(FName objectName);
 
 };


     // Skeleton Animations
     UPROPERTY(EditAnywhere, BlueprintReadOnly)
     TArray<FPaperSkeletonAnimationData> Animations;


Product Version: Not Selected
Tags:
more ▼

asked Dec 07 '14 at 12:25 PM in C++ Programming

avatar image

Diddykonga
115 14 18 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I realized i was using AddUnique when adding FPaperSkeletonSkinData structs to the array, which would need some kind of operator to check if it already existed in the array, therefore making the need for the operator.

Problem solved!

more ▼

answered Dec 07 '14 at 10:13 PM

avatar image

Diddykonga
115 14 18 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question