feat: wip
This commit is contained in:
28
Source/RefinedRDApi/Public/DataAssets/RRDABoilerDataAsset.h
Normal file
28
Source/RefinedRDApi/Public/DataAssets/RRDABoilerDataAsset.h
Normal 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;
|
||||
};
|
||||
22
Source/RefinedRDApi/Public/DataAssets/RRDACoolerDataAsset.h
Normal file
22
Source/RefinedRDApi/Public/DataAssets/RRDACoolerDataAsset.h
Normal 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;
|
||||
};
|
||||
42
Source/RefinedRDApi/Public/DataAssets/RRDADataAssetBase.h
Normal file
42
Source/RefinedRDApi/Public/DataAssets/RRDADataAssetBase.h
Normal 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;
|
||||
};
|
||||
51
Source/RefinedRDApi/Public/DataAssets/RRDADirtDataAsset.h
Normal file
51
Source/RefinedRDApi/Public/DataAssets/RRDADirtDataAsset.h
Normal 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;
|
||||
};
|
||||
36
Source/RefinedRDApi/Public/DataAssets/RRDAHeaterDataAsset.h
Normal file
36
Source/RefinedRDApi/Public/DataAssets/RRDAHeaterDataAsset.h
Normal 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;
|
||||
};
|
||||
29
Source/RefinedRDApi/Public/DataAssets/RRDATurbineDataAsset.h
Normal file
29
Source/RefinedRDApi/Public/DataAssets/RRDATurbineDataAsset.h
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user