Files
FireKrackers/Source/FireworkDuels/BuildingBlock.h

52 lines
1.2 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/StaticMeshComponent.h"
#include "DrawDebugHelpers.h"
#include "BuildingBlock.generated.h"
UCLASS()
class FIREWORKDUELS_API ABuildingBlock : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ABuildingBlock();
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
UStaticMeshComponent* StaticMesh;
// How many hits can this block take before getting destroyed
UPROPERTY(BlueprintReadWrite, EditAnywhere)
int32 HitsRemaining = 1;
UPROPERTY(BlueprintReadOnly)
int32 Index = 0;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
bool HasVariants = false;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
int32 Variant = 0;
UFUNCTION(BlueprintCallable)
void TakeHit();
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void DestroyBlock();
UFUNCTION(BlueprintImplementableEvent)
void FadeIn();
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void DestroyWithDelay();
// Get neighbouring Blocks with same color variant
UFUNCTION(BlueprintCallable)
TArray<ABuildingBlock*> GetSameVariantNeighbours();
};