Reorganize plugin files and start creating some state machine classes
This commit is contained in:
parent
bf2c911b4d
commit
fef1217877
9
Source/UnrealFightingEngine/IFESystemInterface.cpp
Normal file
9
Source/UnrealFightingEngine/IFESystemInterface.cpp
Normal 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)
|
||||
{
|
||||
}
|
33
Source/UnrealFightingEngine/IFESystemInterface.h
Normal file
33
Source/UnrealFightingEngine/IFESystemInterface.h
Normal 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);
|
||||
};
|
5
Source/UnrealFightingEngine/State/FEState.cpp
Normal file
5
Source/UnrealFightingEngine/State/FEState.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
// Project Sword & Gun Copyright Kevin Poretti
|
||||
|
||||
|
||||
#include "FEState.h"
|
||||
|
17
Source/UnrealFightingEngine/State/FEState.h
Normal file
17
Source/UnrealFightingEngine/State/FEState.h
Normal 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()
|
||||
|
||||
};
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
26
Source/UnrealFightingEngine/State/FEStateMachineComponent.h
Normal file
26
Source/UnrealFightingEngine/State/FEStateMachineComponent.h
Normal 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;
|
||||
};
|
@ -10,7 +10,7 @@ public class UnrealFightingEngine : ModuleRules
|
||||
|
||||
PublicIncludePaths.AddRange(
|
||||
new string[] {
|
||||
// ... add public include paths required here ...
|
||||
"UnrealFightingEngine"
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "UnrealFightingEngineBPLibrary.h"
|
||||
#include "UnrealFightingEngine.h"
|
||||
#include "UnrealFightingEngineModule.h"
|
||||
|
||||
UUnrealFightingEngineBPLibrary::UUnrealFightingEngineBPLibrary(const FObjectInitializer& ObjectInitializer)
|
||||
: Super(ObjectInitializer)
|
@ -1,6 +1,6 @@
|
||||
// Copyright Epic Games, Inc. All Rights Reserved.
|
||||
|
||||
#include "UnrealFightingEngine.h"
|
||||
#include "UnrealFightingEngineModule.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FUnrealFightingEngineModule"
|
||||
|
Loading…
Reference in New Issue
Block a user