// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "PartyMember.h" #include "UnitInfo.h" #include "Subsystems/LocalPlayerSubsystem.h" #include "PartySubsystem.generated.h" /** * */ UCLASS(meta=(ShowWorldContextPin)) class SPACEBATTLER_API UPartySubsystem : public UGameInstanceSubsystem { GENERATED_BODY() public: UFUNCTION(BlueprintCallable) int32 SpawnParty(const float InVerticalSpacing, const float InHorizontalOffset, const float InHorizontalSpacing, const int InNumRows); UFUNCTION(BlueprintCallable) void AddToParty(UUnitInfo* UnitInfo); UFUNCTION(BlueprintCallable) TArray GetMembers(); UFUNCTION(BlueprintCallable) TArray GetUnitsByTier(const int32 Tier) const; UFUNCTION(BlueprintCallable) void SetCredits(int32 Amount); UFUNCTION(BlueprintCallable) void SetMemberUnitInfo(FPartyMember& Member, UUnitInfo* UnitInfo); UFUNCTION(BlueprintCallable) bool AllocateMember(FPartyMember& Member); UFUNCTION(BlueprintCallable) bool DeallocateMember(FPartyMember& Member); UFUNCTION(BlueprintCallable) void SetMemberMax(FPartyMember& Member); UFUNCTION(BlueprintCallable) void ClearMember(FPartyMember& Member); UFUNCTION(BlueprintCallable) void SetMemberAvailable(FPartyMember& Member,int32 const Amount); UFUNCTION(BlueprintCallable) int32 GetMemberAvailable(FPartyMember& Member) const; UFUNCTION(BlueprintCallable) int32 GetMemberAllocated(FPartyMember& Member) const; UFUNCTION(BlueprintCallable) UUnitInfo* GetMemberUnitInfo(FPartyMember& Member) const; protected: void SpawnUnits(); UPROPERTY() TArray> SpawnQueue; UPROPERTY(BlueprintReadWrite, EditAnywhere) TArray Members; UPROPERTY(BlueprintReadWrite, EditAnywhere) UPrimaryDataAsset* SelectedGeneral; UPROPERTY(BlueprintReadWrite, EditAnywhere) int32 Credits; FTimerHandle SpawnTimerHandle; int32 LastSpawnIndex; int32 NumRows; int32 CurrentColumn; float HorizontalOffset; float VerticalSpacing; float HorizontalSpacing; };