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.
93 lines
2.3 KiB
93 lines
2.3 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;
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
int32 GetTotalAvailablePartyMembers();
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
int32 GetTotalAllocatedPartyMembers();
|
|
|
|
protected:
|
|
void SpawnUnits();
|
|
|
|
UPROPERTY()
|
|
TArray<TSubclassOf<AActor>> SpawnQueue;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
|
TArray<FPartyMember> Members;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
|
UPrimaryDataAsset* SelectedGeneral;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere)
|
|
int32 Credits;
|
|
|
|
UPROPERTY()
|
|
AActor* SpawnPoint;
|
|
|
|
FTimerHandle SpawnTimerHandle;
|
|
int32 LastSpawnIndex;
|
|
int32 NumRows;
|
|
int32 CurrentColumn;
|
|
float HorizontalOffset;
|
|
float VerticalSpacing;
|
|
float HorizontalSpacing;
|
|
};
|