You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
absg/Source/SpaceBattler/Public/PartySubsystem.h

84 lines
2.2 KiB

// 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<FPartyMember> GetMembers();
UFUNCTION(BlueprintCallable)
TArray<UUnitInfo*> GetUnitsByTier(const int32 Tier) const;
UFUNCTION(BlueprintCallable)
void SetCredits(int32 Amount);
UFUNCTION(BlueprintCallable)
void SetMemberUnitInfo(UPARAM(ref) FPartyMember& Member, UUnitInfo* UnitInfo);
UFUNCTION(BlueprintCallable)
bool AllocateMember(UPARAM(ref) FPartyMember& Member);
UFUNCTION(BlueprintCallable)
bool DeallocateMember(UPARAM(ref) FPartyMember& Member);
UFUNCTION(BlueprintCallable)
void SetMemberMax(UPARAM(ref) FPartyMember& Member);
UFUNCTION(BlueprintCallable)
void ClearMember(UPARAM(ref) FPartyMember& Member);
UFUNCTION(BlueprintCallable)
void SetMemberAvailable(UPARAM(ref) FPartyMember& Member,int32 const Amount);
UFUNCTION(BlueprintCallable)
int32 GetMemberAvailable(UPARAM(ref) FPartyMember& Member) const;
UFUNCTION(BlueprintCallable)
int32 GetMemberAllocated(UPARAM(ref) FPartyMember& Member) const;
UFUNCTION(BlueprintCallable)
UUnitInfo* GetMemberUnitInfo(UPARAM(ref) FPartyMember& Member) const;
protected:
void SpawnUnits();
UPROPERTY()
TArray<TSubclassOf<AActor>> SpawnQueue;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TArray<FPartyMember> 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;
};