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

플레이어(지휘관)의 자산(영웅, 병사, 장비)을 관리하는 컴포넌트 More...

#include <InventorySystem.h>

Inheritance diagram for UInventorySystem:
Inheritance graph
Collaboration diagram for UInventorySystem:
Collaboration graph

Public Member Functions

void SetCharacterLevelAndExp (FName CharacterID, int32 NewLevel, int32 NewExp)
 성장 시스템이 계산한 최종 레벨/경험치 덮어쓰기
void EquipItemToCharacter (FGuid CharacterUID, FGuid ItemUID)
 특정 캐릭터(UID 기반)에게 장비를 장착시킵니다.
void UnEquipItemFromCharacter (FGuid CharacterUID, EEquipmentSlot Slot)
 특정 캐릭터(UID 기반)의 특정 슬롯 장비를 해제합니다.
void InitInventory (const TArray< FOwnedCharacterData > &InHeroes, const TArray< FOwnedFamiliarData > &InFamiliars, const TArray< FOwnedItemData > &InItems)
 계정 데이터로부터 인벤토리를 초기화하는 함수
void AddItem (FName ItemID, int32 Count=1, int32 EnhancementLvl=0)
 아이템(퍼밀리어 , 장비)을 인벤토리에 추가하는 함수
void AddCharacter (FName CharacterID)
 영웅을 획득하는 함수
void AddFamiliar (FName FamiliarID)
 퍼밀리어을 획득하는 함수
void AddAwakeningPiece (FName CharacterID, int32 Count)
 각성 조각 수치 추가
bool RemoveObjectByGUID (FGuid TargetGUID, int32 Count=1)
 통합 삭제 함수
bool SellItem (FGuid ItemUID, int32 QuantityToSell, FString &OutErrorMsg)
 장비/아이템을 판매합니다.
const TArray< FOwnedCharacterData > & GetOwnedCharacters () const
const TArray< FOwnedFamiliarData > & GetOwnedFamiliars () const
const TArray< FOwnedItemData > & GetOwnedItems () const
FOwnedItemDataGetItemByGUID (FGuid TargetUID)
 GUID로 아이템 데이터 포인터 반환 (장비 장착 시 필수).
int32 GetItemQuantity (FName ItemID) const
 특정 아이템의 현재 보유 개수를 반환합니다.
bool HasCharacter (FName CharacterID) const
 특정 영웅을 보유하고 있는지 확인
const FOwnedCharacterDataGetCharacterDataByID (FName CharacterID) const
 ID로 보유 캐릭터의 상세 데이터를 (ID기반으로) 검색하여 반환합니다.
FOwnedCharacterDataGetMutableCharacterDataByID (FName CharacterID)
 캐릭터 정보 수정을 위한 Mutable 데이터 반환 (성장 시스템 전용)
EEquipmentSlot FindEquipmentSlot (FName ItemID) const
 아이템 ID를 기반으로 장착되어야 할 슬롯을 찾습니다.
virtual void SaveToSaveGame (class UParadiseSaveGame *SaveGameObj) const override
virtual void LoadFromSaveGame (class UParadiseSaveGame *SaveGameObj) override

Public Attributes

FOnInventoryUpdated OnInventoryUpdated
 인벤토리 변경 시 호출되는 델리게이트 (UI)
FOnEquipmentUpdated OnEquipmentUpdated
 장비 변경 시 호출되는 이벤트 (UI 갱신용)

Protected Attributes

TArray< FOwnedCharacterDataOwnedCharacters
TArray< FOwnedFamiliarDataOwnedFamiliars
TArray< FOwnedItemDataOwnedItems

Detailed Description

플레이어(지휘관)의 자산(영웅, 병사, 장비)을 관리하는 컴포넌트

  • PlayerState에 부착되어 사용됩니다.
  • GameInstance로부터 데이터를 받아 초기화(Init)합니다.
  • 획득(Add) 및 소모(Remove) 시 데이터 테이블을 통해 ID 유효성을 검증합니다.

Member Function Documentation

◆ AddCharacter()

void UInventorySystem::AddCharacter ( FName CharacterID)

영웅을 획득하는 함수

이미 보유 중인 경우, 영혼석(조각)으로 대체하거나 레벨업 재료로 변환하는 로직이 추가될 수 있습니다.

Parameters
CharacterID획득한 영웅의 ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddFamiliar()

void UInventorySystem::AddFamiliar ( FName FamiliarID)

퍼밀리어을 획득하는 함수

Parameters
CharacterID획득한 영웅의 ID
Here is the call graph for this function:

◆ AddItem()

void UInventorySystem::AddItem ( FName ItemID,
int32 Count = 1,
int32 EnhancementLvl = 0 )

아이템(퍼밀리어 , 장비)을 인벤토리에 추가하는 함수

Note
내부적으로 ItemDataTable을 통해 유효한 ID인지 검증합니다.
Parameters
ItemID추가할 아이템의 RowName (ID)
Count추가할 개수 (기본값 1)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EquipItemToCharacter()

void UInventorySystem::EquipItemToCharacter ( FGuid CharacterUID,
FGuid ItemUID )

특정 캐릭터(UID 기반)에게 장비를 장착시킵니다.

Parameters
CharacterUID: 장비를 착용할 캐릭터의 고유 ID (FGuid)
ItemUID: 장착할 아이템의 GUID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindEquipmentSlot()

EEquipmentSlot UInventorySystem::FindEquipmentSlot ( FName ItemID) const

아이템 ID를 기반으로 장착되어야 할 슬롯을 찾습니다.

무기/방어구 테이블을 조회하고 태그를 비교합니다.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCharacterDataByID()

const FOwnedCharacterData * UInventorySystem::GetCharacterDataByID ( FName CharacterID) const

ID로 보유 캐릭터의 상세 데이터를 (ID기반으로) 검색하여 반환합니다.

Returns
데이터를 찾으면 포인터 반환, 없으면 nullptr
Here is the caller graph for this function:

◆ GetItemByGUID()

FOwnedItemData * UInventorySystem::GetItemByGUID ( FGuid TargetUID)

GUID로 아이템 데이터 포인터 반환 (장비 장착 시 필수).

Returns
찾지 못하면 nullptr
Here is the caller graph for this function:

◆ GetItemQuantity()

int32 UInventorySystem::GetItemQuantity ( FName ItemID) const

특정 아이템의 현재 보유 개수를 반환합니다.

Parameters
ItemID확인할 아이템 ID
Returns
int32 보유 수량 (없으면 0)

◆ GetOwnedCharacters()

const TArray< FOwnedCharacterData > & UInventorySystem::GetOwnedCharacters ( ) const
inline
Returns
현재 보유 중인 모든 영웅 목록 (const 참조)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetOwnedFamiliars()

const TArray< FOwnedFamiliarData > & UInventorySystem::GetOwnedFamiliars ( ) const
inline
Returns
현재 보유 중인 모든 퍼밀리어 목록 (const 참조)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetOwnedItems()

const TArray< FOwnedItemData > & UInventorySystem::GetOwnedItems ( ) const
inline
Returns
현재 보유 중인 모든 아이템 목록 (const 참조)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitInventory()

void UInventorySystem::InitInventory ( const TArray< FOwnedCharacterData > & InHeroes,
const TArray< FOwnedFamiliarData > & InFamiliars,
const TArray< FOwnedItemData > & InItems )

계정 데이터로부터 인벤토리를 초기화하는 함수

GameInstance(SaveFile)에 저장된 배열을 그대로 복사하여 가져옵니다.

Parameters
InHeroes로드된 영웅 목록
InFamiliars로드된 퍼밀리어(병사) 목록
InItems로드된 장비/아이템 목록
Here is the call graph for this function:

◆ LoadFromSaveGame()

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

◆ RemoveObjectByGUID()

bool UInventorySystem::RemoveObjectByGUID ( FGuid TargetGUID,
int32 Count = 1 )

통합 삭제 함수

인벤토리 내의 영웅, 병사, 아이템을 모두 뒤져서 해당 GUID를 가진 객체를 삭제합니다.

Returns
성공 시 true

◆ SaveToSaveGame()

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

◆ SellItem()

bool UInventorySystem::SellItem ( FGuid ItemUID,
int32 QuantityToSell,
FString & OutErrorMsg )

장비/아이템을 판매합니다.

*

Parameters
ItemUID팔고자 하는 아이템의 고유 번호
QuantityToSell팔 개수 (장비는 보통 1개씩 팔지만 겹치는 아이템을 위해 추가)
Returns
판매 성공 여부
Here is the call graph for this function:

Member Data Documentation

◆ OnEquipmentUpdated

FOnEquipmentUpdated UInventorySystem::OnEquipmentUpdated

장비 변경 시 호출되는 이벤트 (UI 갱신용)

◆ OnInventoryUpdated

FOnInventoryUpdated UInventorySystem::OnInventoryUpdated

인벤토리 변경 시 호출되는 델리게이트 (UI)

◆ OwnedCharacters

TArray<FOwnedCharacterData> UInventorySystem::OwnedCharacters
protected

[영웅] 지휘관이 보유한 영웅들 (ID, Level, Awakening)

◆ OwnedFamiliars

TArray<FOwnedFamiliarData> UInventorySystem::OwnedFamiliars
protected

[퍼밀리어] 지휘관이 보유한 병사들 (ID, Level, Quantity)

◆ OwnedItems

TArray<FOwnedItemData> UInventorySystem::OwnedItems
protected

[아이템] 보유한 장비 및 소모품 (ID, Enhancement, Quantity)


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