Reorganize plugin files and start creating some state machine classes

This commit is contained in:
Kevin Poretti 2023-06-03 14:37:14 -04:00
parent bf2c911b4d
commit fef1217877
11 changed files with 122 additions and 3 deletions

View File

@ -0,0 +1,9 @@
// Project Sword & Gun Copyright Kevin Poretti
#include "IFESystemInterface.h"
// Add default functionality here for any IIFESystemInterface functions that are not pure virtual.
void IIFESystemInterface::FixedTick(float OneFrame)
{
}

View File

@ -0,0 +1,33 @@
// Project Sword & Gun Copyright Kevin Poretti
#pragma once
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "IFESystemInterface.generated.h"
// This class does not need to be modified.
UINTERFACE(MinimalAPI)
class UIFESystemInterface : public UInterface
{
GENERATED_BODY()
};
/**
* This interface defines functions that need to be implemented for any objects that are "gameplay affecting".
*
* This ensures all gameplay effecting objects can be assumed to have certain properties that enable serialization, networking and
* some form of determinism.
*/
class UNREALFIGHTINGENGINE_API IIFESystemInterface
{
GENERATED_BODY()
public:
/**
* Function to be called at a fixed interval/frame rate rather than using Unreal's variable Tick function
*
* @param OneFrame the time that elapses during one fixed tick
*/
virtual void FixedTick(float OneFrame);
};

View File

@ -0,0 +1,5 @@
// Project Sword & Gun Copyright Kevin Poretti
#include "FEState.h"

View File

@ -0,0 +1,17 @@
// Project Sword & Gun Copyright Kevin Poretti
#pragma once
#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "FEState.generated.h"
/**
*
*/
UCLASS()
class UNREALFIGHTINGENGINE_API UFEState : public UObject
{
GENERATED_BODY()
};

View File

@ -0,0 +1,29 @@
// Project Sword & Gun Copyright Kevin Poretti
#include "FEStateMachineComponent.h"
// Sets default values for this component's properties
UFEStateMachineComponent::UFEStateMachineComponent()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = false;
// ...
}
// Called when the game starts
void UFEStateMachineComponent::BeginPlay()
{
Super::BeginPlay();
// ...
}
void UFEStateMachineComponent::FixedTick(float OneFrame)
{
}

View File

@ -0,0 +1,26 @@
// Project Sword & Gun Copyright Kevin Poretti
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "UnrealFightingEngine/IFESystemInterface.h"
#include "FEStateMachineComponent.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class UNREALFIGHTINGENGINE_API UFEStateMachineComponent : public UActorComponent, public IIFESystemInterface
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UFEStateMachineComponent();
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
virtual void FixedTick(float OneFrame) override;
};

View File

@ -10,7 +10,7 @@ public class UnrealFightingEngine : ModuleRules
PublicIncludePaths.AddRange( PublicIncludePaths.AddRange(
new string[] { new string[] {
// ... add public include paths required here ... "UnrealFightingEngine"
} }
); );

View File

@ -1,7 +1,7 @@
// Copyright Epic Games, Inc. All Rights Reserved. // Copyright Epic Games, Inc. All Rights Reserved.
#include "UnrealFightingEngineBPLibrary.h" #include "UnrealFightingEngineBPLibrary.h"
#include "UnrealFightingEngine.h" #include "UnrealFightingEngineModule.h"
UUnrealFightingEngineBPLibrary::UUnrealFightingEngineBPLibrary(const FObjectInitializer& ObjectInitializer) UUnrealFightingEngineBPLibrary::UUnrealFightingEngineBPLibrary(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer) : Super(ObjectInitializer)

View File

@ -1,6 +1,6 @@
// Copyright Epic Games, Inc. All Rights Reserved. // Copyright Epic Games, Inc. All Rights Reserved.
#include "UnrealFightingEngine.h" #include "UnrealFightingEngineModule.h"
#define LOCTEXT_NAMESPACE "FUnrealFightingEngineModule" #define LOCTEXT_NAMESPACE "FUnrealFightingEngineModule"