// Project Sword & Gun Copyright © 2021 Kevin Poretti

#include "SNGTypes.generated.h"
#pragma once

#define SNG_SURFACE_DEFAULT				SurfaceType_Default
#define SNG_SURFACE_FLESH				SurfaceType1
#define SNG_SURFACE_FLESH_VULNERABLE	SurfaceType2

UENUM(BlueprintType)
enum class ESNGEventType : uint8
{
	CHARACTER_COMMAND,
	DAMAGE,
	MAX_EVENT_TYPES,
};

USTRUCT(BlueprintType)
struct FSNGEventData
{
	GENERATED_BODY()

	FSNGEventData()
	{
	}
};

USTRUCT(BlueprintType)
struct FSNGCharacterCommandData : public FSNGEventData
{
	GENERATED_BODY()

	UPROPERTY(BlueprintReadOnly)
	FName CommandName;
	
	FSNGCharacterCommandData()
		: CommandName(NAME_None)
	{
	}
};

USTRUCT(BlueprintType)
struct FSNGDamageData : public FSNGEventData
{
	GENERATED_BODY()

	UPROPERTY(BlueprintReadOnly)
	float BaseDamage;

	UPROPERTY(BlueprintReadOnly)
	FVector HitForce;

	FSNGDamageData()
        : BaseDamage(0.0f)
	{
	}
};

// discriminated union
USTRUCT(BlueprintType)
struct FSNGEvent
{
	GENERATED_BODY()

	UPROPERTY(BlueprintReadOnly)
	ESNGEventType EventType;

	union
	{
		FSNGCharacterCommandData CommandData;
		FSNGDamageData DamageData;
	};
	
	FSNGEvent()
		: EventType()
		, CommandData()
		, DamageData()
	{
	}
};

