Optimize code to unreal style

This commit is contained in:
martinluckyrobots
2025-04-07 11:32:45 +08:00
parent 5d8e225db5
commit 4d4026d9ad
19 changed files with 306 additions and 315 deletions

View File

@ -26,7 +26,6 @@ public:
public:
bool bIsFirstOpenGame;
bool bIsDebug;
bool bIsWidgetTestMode;
bool bIsShowPath;
@ -48,10 +47,10 @@ public:
bool bIsMouseOpen;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
bool bIschange;
bool bIsChanged;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
int FolderCount;
int32 FolderCount;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture")
FTransform TargetPosition;
@ -90,10 +89,10 @@ public:
public:
UFUNCTION(BlueprintCallable)
void DoSendMessage(FString SendValue);
void DoSendMessage(const FString& SendValue);
UFUNCTION(BlueprintCallable)
void DoLogItemAdd(FString Topic, FString MsgText, ELogItemType LogItemType);
void DoLogItemAdd(const FString& Topic, const FString& MsgText, ELogItemType LogItemType);
UFUNCTION(BlueprintCallable)
void SwitchGamePaused();
@ -103,41 +102,41 @@ public:
void ClearTaskList();
UFUNCTION(BlueprintCallable)
void AddTask(FGoalsTaskData TaskData);
void AddTask(const FGoalsTaskData& TaskData);
UFUNCTION(BlueprintCallable)
void RemoveTask(FGoalsTaskData TaskData);
void RemoveTask(const FGoalsTaskData& TaskData);
UFUNCTION(BlueprintCallable)
void RemoveTaskByGoalType(EGoalType GoalType);
UFUNCTION(BlueprintPure)
int GetTaskNum();
int32 GetTaskNum() const;
UFUNCTION(BlueprintCallable)
void SetTask(int Index, FGoalsTaskData TaskData);
void SetTask(int32 Index, const FGoalsTaskData& TaskData);
UFUNCTION(BlueprintCallable)
bool GetTask(int Index, FGoalsTaskData& TaskData);
bool GetTask(int32 Index, FGoalsTaskData& OutTaskData) const;
UFUNCTION(BlueprintCallable)
void ReSetTaskList();
UFUNCTION(BlueprintPure)
TArray<FGoalsTaskData> GetTaskList();
TArray<FGoalsTaskData> GetTaskList() const;
UFUNCTION(BlueprintCallable)
void DoSetTempTaskValueChange(bool IsClear);
void DoSetTempTaskValueChange(bool bIsClear);
public:
UFUNCTION(BlueprintCallable)
void SetCurrentFolderName(FString FolderName);
void SetCurrentFolderName(const FString& FolderName);
UFUNCTION(BlueprintCallable)
void SetCurrentFileName(FString FileName);
void SetCurrentFileName(const FString& FileName);
UFUNCTION(BlueprintCallable)
void SetCurrentWritesPerSec(int WritesPerSec);
void SetCurrentWritesPerSec(int32 WritesPerSec);
UFUNCTION(BlueprintCallable)
void SetCurrentIsScenario(bool IsScenario);
@ -155,77 +154,77 @@ public:
void SetCurrentIsRandomPets(bool bPets);
UFUNCTION(BlueprintCallable)
void SetCurrentPetsNumber(int PetsNumber);
void SetCurrentPetsNumber(int32 PetsNumber);
UFUNCTION(BlueprintCallable)
void SetCurrentIsRandomPeople(bool bPeople);
UFUNCTION(BlueprintCallable)
void SetCurrentPeopleNumber(int PeopleNumber);
void SetCurrentPeopleNumber(int32 PeopleNumber);
UFUNCTION(BlueprintCallable)
void SetCurrentIsRandomObjects(bool bObjects);
UFUNCTION(BlueprintCallable)
void SetCurrentObjectsNumber(int ObjectsNumber);
void SetCurrentObjectsNumber(int32 ObjectsNumber);
UFUNCTION(BlueprintCallable)
void SetCurrentRandomMeshes(TArray<TSoftObjectPtr<UStaticMeshComponent>> RandomMeshes);
void SetCurrentRandomMeshes(const TArray<TSoftObjectPtr<UStaticMeshComponent>>& RandomMeshes);
UFUNCTION(BlueprintCallable)
void SetCurrentIsInfiniteCapture(bool bInfiniteCapture);
UFUNCTION(BlueprintCallable)
void SetCurrentCaptureNumber(int CaptureNumber);
void SetCurrentCaptureNumber(int32 CaptureNumber);
public:
UFUNCTION(BlueprintPure)
FString GetCurrentFolderName();
FString GetCurrentFolderName() const;
UFUNCTION(BlueprintPure)
FString GetCurrentFileName();
FString GetCurrentFileName() const;
UFUNCTION(BlueprintPure)
int GetCurrentWritesPerSec();
int32 GetCurrentWritesPerSec() const;
UFUNCTION(BlueprintPure)
bool GetCurrentIsScenario();
bool GetCurrentIsScenario() const;
UFUNCTION(BlueprintPure)
bool GetCurrentIsRandomLight();
bool GetCurrentIsRandomLight() const;
UFUNCTION(BlueprintPure)
bool GetCurrentIsRandomMaterials();
bool GetCurrentIsRandomMaterials() const;
UFUNCTION(BlueprintPure)
bool GetCurrentIsRandomRobotPosition();
bool GetCurrentIsRandomRobotPosition() const;
UFUNCTION(BlueprintPure)
bool GetCurrentIsRandomPets();
bool GetCurrentIsRandomPets() const;
UFUNCTION(BlueprintPure)
int GetCurrentPetsNumber();
int32 GetCurrentPetsNumber() const;
UFUNCTION(BlueprintPure)
bool GetCurrentIsRandomPeople();
bool GetCurrentIsRandomPeople() const;
UFUNCTION(BlueprintPure)
int GetCurrentPeopleNumber();
int32 GetCurrentPeopleNumber() const;
UFUNCTION(BlueprintPure)
bool GetCurrentIsRandomObjects();
bool GetCurrentIsRandomObjects() const;
UFUNCTION(BlueprintPure)
int GetCurrentObjectsNumber();
int32 GetCurrentObjectsNumber() const;
UFUNCTION(BlueprintPure)
TArray<TSoftObjectPtr<UStaticMeshComponent>> GetCurrentRandomMeshes();
TArray<TSoftObjectPtr<UStaticMeshComponent>> GetCurrentRandomMeshes() const;
UFUNCTION(BlueprintPure)
bool GetCurrentIsInfiniteCapture();
bool GetCurrentIsInfiniteCapture() const;
UFUNCTION(BlueprintPure)
int GetCurrentCaptureNumber();
int32 GetCurrentCaptureNumber() const;
public:
UFUNCTION(BlueprintImplementableEvent)