Paradies Project
Loading...
Searching...
No Matches
UEconomySubsystem Class Reference

게임 내 모든 재화(화폐)의 획득, 소모, 보유량 조회를 전담하는 경제 매니저 클래스입니다. More...

#include <EconomySubsystem.h>

Inheritance diagram for UEconomySubsystem:
Inheritance graph
Collaboration diagram for UEconomySubsystem:
Collaboration graph

Public Member Functions

virtual void Initialize (FSubsystemCollectionBase &Collection) override
 서브시스템이 생성될 때 최초 1회 호출되는 초기화 함수입니다.
int32 GetCurrency (ECurrencyType Type) const
 특정 재화의 현재 보유량을 반환합니다.
void AddCurrency (ECurrencyType Type, int32 Amount)
 특정 재화를 지갑에 추가(획득)합니다.
bool ConsumeCurrency (ECurrencyType Type, int32 Amount)
 특정 재화를 지갑에서 차감(소모)합니다.
bool HasEnoughCurrency (ECurrencyType Type, int32 Amount) const
 특정 재화를 요구량만큼 충분히 가지고 있는지 검사합니다.
virtual void LoadFromSaveGame (class UParadiseSaveGame *SaveGameObj) override
 세이브 파일 객체에서 저장된 지갑 데이터를 읽어와 메모리에 복구합니다.
virtual void SaveToSaveGame (class UParadiseSaveGame *SaveGameObj) const override
 현재 서브시스템이 가진 지갑 데이터를 세이브 파일 객체에 기록합니다.

Public Attributes

FOnCurrencyChangedSignature OnCurrencyChanged
 재화 수량이 바뀔 때마다 UI(상단 바, 로비 등)에 갱신 신호를 보내는 이벤트 디스패처입니다.

Detailed Description

게임 내 모든 재화(화폐)의 획득, 소모, 보유량 조회를 전담하는 경제 매니저 클래스입니다.

GameInstance 수명주기와 함께하며, 맵 전환 시에도 유저의 재화 데이터가 안전하게 유지됩니다. 상점, 가챠, 스테이지 보상 등 재화가 오가는 모든 시스템의 허브 역할을 수행합니다.

Member Function Documentation

◆ AddCurrency()

void UEconomySubsystem::AddCurrency ( ECurrencyType Type,
int32 Amount )

특정 재화를 지갑에 추가(획득)합니다.

*

Parameters
Type획득할 재화의 종류
Amount획득할 수량 (0 이하는 무시됨)

호출 완료 시 OnCurrencyChanged 델리게이트가 자동으로 방송(Broadcast)됩니다.

Here is the call graph for this function:

◆ ConsumeCurrency()

bool UEconomySubsystem::ConsumeCurrency ( ECurrencyType Type,
int32 Amount )

특정 재화를 지갑에서 차감(소모)합니다.

*

Parameters
Type소모할 재화의 종류
Amount소모할 수량
Returns
소모에 성공하면 true, 잔액이 부족하여 실패하면 false를 반환합니다.

잔액 검사를 먼저 수행하며, 소모에 성공했을 때만 재화가 차감되고 OnCurrencyChanged가 방송됩니다.

Here is the call graph for this function:

◆ GetCurrency()

int32 UEconomySubsystem::GetCurrency ( ECurrencyType Type) const

특정 재화의 현재 보유량을 반환합니다.

*

Parameters
Type조회할 재화의 종류
Returns
현재 보유 중인 해당 재화의 수량 (발견하지 못할 경우 0)
Here is the caller graph for this function:

◆ HasEnoughCurrency()

bool UEconomySubsystem::HasEnoughCurrency ( ECurrencyType Type,
int32 Amount ) const

특정 재화를 요구량만큼 충분히 가지고 있는지 검사합니다.

*

Parameters
Type검사할 재화의 종류
Amount필요한 요구 수량
Returns
보유량이 요구량 이상이면 true, 부족하면 false 반환
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialize()

void UEconomySubsystem::Initialize ( FSubsystemCollectionBase & Collection)
overridevirtual

서브시스템이 생성될 때 최초 1회 호출되는 초기화 함수입니다.

내부적으로 Wallet(지갑) 맵을 순회하며 초기값을 0으로 세팅합니다.

◆ LoadFromSaveGame()

void UEconomySubsystem::LoadFromSaveGame ( class UParadiseSaveGame * SaveGameObj)
overridevirtual

세이브 파일 객체에서 저장된 지갑 데이터를 읽어와 메모리에 복구합니다.

Parameters
SaveGameObj로드된 세이브 게임 객체 포인터

Implements IParadiseSaveInterface.

◆ SaveToSaveGame()

void UEconomySubsystem::SaveToSaveGame ( class UParadiseSaveGame * SaveGameObj) const
overridevirtual

현재 서브시스템이 가진 지갑 데이터를 세이브 파일 객체에 기록합니다.

Parameters
SaveGameObj기록할 세이브 게임 객체 포인터

Implements IParadiseSaveInterface.

Member Data Documentation

◆ OnCurrencyChanged

FOnCurrencyChangedSignature UEconomySubsystem::OnCurrencyChanged

재화 수량이 바뀔 때마다 UI(상단 바, 로비 등)에 갱신 신호를 보내는 이벤트 디스패처입니다.


The documentation for this class was generated from the following files:
  • Source/Paradise/Public/Framework/System/EconomySubsystem.h
  • Source/Paradise/Private/Framework/System/EconomySubsystem.cpp