Compare commits

...

2 commits

Author SHA1 Message Date
25e85ebf6f Created and added a DataTable with recipes to the OvenPawn in the level 2023-11-12 10:45:33 +02:00
18456fb3f1 Updated FMeal
Added visibility modifiers to the struct members
2023-11-12 10:45:03 +02:00
4 changed files with 46 additions and 4 deletions

Binary file not shown.

View file

@ -0,0 +1,26 @@
[
{
"Name": "1",
"ID": 0,
"MealName": "",
"TargetHeat": 0.5,
"HeatHalfRange": 0.1,
"TotalCookingTimeMS": 5000.0
},
{
"Name": "2",
"ID": 1,
"MealName": "Lasagna",
"TargetHeat": 0.5,
"HeatHalfRange": 0.1,
"TotalCookingTimeMS": 5000.0
},
{
"Name": "3",
"ID": 2,
"MealName": "Alfredo",
"TargetHeat": 0.5,
"HeatHalfRange": 0.1,
"TotalCookingTimeMS": 5000.0
}
]

View file

@ -10,17 +10,31 @@
#include "OvenPawn.generated.h"
// todo(stefan): Revisit this meal struct, not all fields are needed/make sense. Good enough for now.
USTRUCT()
struct FMeal : public FTableRowBase
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Meal", meta=(Tooltip = "The ID of the meal recipe"))
int32 ID{-1};
FString MealName;
double TargetHeat{0.0};
double HeatHalfRange{0.0};
double TotalCookingTimeMS{0.0};
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Meal", meta=(Tooltip = "The name of the meal recipe"))
FText MealName = FText::FromString("DefaultMealName");
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Meal",
meta=(Tooltip = "The target value of 'heat' for the perfect cooking temperature"))
double TargetHeat{0.5};
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Meal",
meta=(Tooltip =
"The half-range of the target value of the cooking temperature, e.g. if @param TargetHeat is 0.5 and @param HalfHeatRange is 0.1, anything between 0.4 and 0.6 is perfect heat"
))
double HeatHalfRange{0.1};
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Meal", meta=(Tooltip = "The total cooking time for this meal recipe, in milliseconds"))
double TotalCookingTimeMS{5000.0};
};
struct FCookingStats
@ -129,6 +143,8 @@ private:
TArray<TObjectPtr<AActor>> CookstoveObjects;
TArray<FCookstove> Cookstoves;
public:
// ReSharper disable once CppUE4ProbableMemoryIssuesWithUObject
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Oven Settings")
TObjectPtr<UDataTable> RecipesDataTable;
};