feat: wip

This commit is contained in:
2024-10-24 18:06:58 +02:00
commit c7f5bd9326
35 changed files with 1226 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "RRDADataAssetBase.h"
#include "ItemAmount.h"
#include "RRDABoilerDataAsset.generated.h"
UCLASS( BlueprintType )
class REFINEDRDAPI_API URRDABoilerDataAsset : public URRDADataAssetBase
{
GENERATED_BODY()
public:
/**
* Fuel item that this heater uses
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Boiler")
FItemAmount mItem;
/**
* What this boiler produces
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Boiler")
FItemAmount mOutputItem;
};

View File

@@ -0,0 +1,22 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "ItemAmount.h"
#include "RRDADataAssetBase.h"
#include "RRDACoolerDataAsset.generated.h"
UCLASS( BlueprintType )
class REFINEDRDAPI_API URRDACoolerDataAsset : public URRDADataAssetBase
{
GENERATED_BODY()
public:
/**
* Fuel item that this heater uses
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cooler")
FItemAmount mItem;
};

View File

@@ -0,0 +1,42 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "RRDADataAssetBase.generated.h"
UCLASS( BlueprintType )
class REFINEDRDAPI_API URRDADataAssetBase : public UPrimaryDataAsset
{
GENERATED_BODY()
protected:
/**
* Can be overridden to disable the asset or make some other checks
*/
virtual bool IsEnabled_Internal(UObject* WorldContextObject) const
{
return !mIsDisabled;
}
virtual FPrimaryAssetId GetPrimaryAssetId() const override
{
return FPrimaryAssetId(FPrimaryAssetType("RRDADataAsset"), GetFName());
}
public:
UFUNCTION( BlueprintPure, Category="FicsitFarming|Dirt" )
static bool IsEnabled(URRDADataAssetBase* Asset, UObject* WorldContextObject)
{
if(!Asset) return false;
return Asset->IsEnabled_Internal(WorldContextObject);
};
/**
* Disable this asset from being used in the game
* For example if a mod is disabling some content from another mod
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Asset")
bool mIsDisabled;
};

View File

@@ -0,0 +1,51 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "RRDADataAssetBase.h"
#include "ItemAmount.h"
#include "RRDADirtDataAsset.generated.h"
UCLASS( BlueprintType )
class REFINEDRDAPI_API URRDADirtDataAsset : public URRDADataAssetBase
{
GENERATED_BODY()
public:
UFUNCTION( BlueprintPure, Category="FicsitFarming|Dirt" )
static TArray<FItemAmount> GetExtractableSeed(URRDADirtDataAsset* Asset);
UFUNCTION( BlueprintPure, Category="FicsitFarming|Dirt" )
static float GetExtractionCycleTime(URRDADirtDataAsset* Asset);
UFUNCTION( BlueprintPure, Category="FicsitFarming|Dirt" )
static int32 GetDirtConsume(URRDADirtDataAsset* Asset);
public:
/**
* What Item should be a Dirt?
* @warning - If 2 DirtDataAssets have the same Item, the game will use the last one which was loaded
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "FicsitFarming")
TSubclassOf<UFGItemDescriptor> mItem;
/**
* Seeds that can be extracted from this dirt every cycle
*/
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category="FicsitFarming" )
TArray<FItemAmount> mExtractableSeed;
/**
* Production time for the extraction of seeds
*/
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category="FicsitFarming" )
float mExtractionCycleTime = 6.0f;
/**
* How much dirt should be consumed?
*/
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category="FicsitFarming" )
int32 mDirtConsume = 2;
};

View File

@@ -0,0 +1,36 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "RRDADataAssetBase.h"
#include "ItemAmount.h"
#include "Enums/RRDARPEnums.h"
#include "RRDAHeaterDataAsset.generated.h"
UCLASS( BlueprintType )
class REFINEDRDAPI_API URRDAHeaterDataAsset : public URRDADataAssetBase
{
GENERATED_BODY()
public:
/**
* What type of heater this is
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Heater")
ERRDAHeaterType mHeaterType;
/**
* Fuel item that this heater uses
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Heater")
FItemAmount mInput;
/**
* Item that this turbine produces
* @Note - Can be nullptr
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Heater")
FItemAmount mOutput;
};

View File

@@ -0,0 +1,29 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "RRDADataAssetBase.h"
#include "ItemAmount.h"
#include "RRDATurbineDataAsset.generated.h"
UCLASS( BlueprintType )
class REFINEDRDAPI_API URRDATurbineDataAsset : public URRDADataAssetBase
{
GENERATED_BODY()
public:
/**
* Fuel item that this heater uses
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Turbine")
FItemAmount mItem;
/**
* Item that this turbine produces
* @Note - Can be nullptr so that the turbine doesn't produce anything
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Turbine")
FItemAmount mWasteItem;
};