KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
ULevelWordGroup 클래스 참조

특정 WordType의 단어 아이템들을 그룹으로 묶어서 표시하는 위젯 더 자세히 ...

#include <ULevelWordGroup.h>

+ ULevelWordGroup에 대한 상속 다이어그램 :
+ ULevelWordGroup에 대한 협력 다이어그램:

Public 멤버 함수

void InitGroup (EWordType InWordType, int32 InCurrentLevel)
 그룹 정보를 초기화하고 아이템들을 생성
 
void SetColumnCount (int32 InColumnCount)
 그리드에 표시할 열의 개수를 설정
 

Public 속성

TObjectPtr< class UImage > Image_Symbol
 그룹 심볼 이미지
 
TObjectPtr< class UTextBlock > Text_GroupName
 그룹 이름 텍스트
 
TObjectPtr< class UUniformGridPanel > UniformGridPanel
 아이템들이 배치될 Uniform Grid Panel
 

Protected 멤버 함수

void PopulateItems ()
 아이템들을 Uniform Grid Panel에 배치
 
void UpdateGroupTitle ()
 그룹 타이틀을 업데이트
 

Protected 속성

int32 ColumnCount = 2
 그리드 열 개수 (기본값: 2)
 
int32 CurrentLevel = 1
 현재 선택된 레벨
 
TSubclassOf< class ULevelWordItemLevelWordItemClass
 생성할 아이템 위젯 클래스
 
EWordType WordType
 현재 그룹의 단어 타입
 

상세한 설명

특정 WordType의 단어 아이템들을 그룹으로 묶어서 표시하는 위젯

Uniform Grid Panel에 ULevelWordItem들을 배치하여 단어 그룹을 시각화

ULevelWordGroup.h 파일의 15 번째 라인에서 정의되었습니다.

멤버 함수 문서화

◆ InitGroup()

void ULevelWordGroup::InitGroup ( EWordType  InWordType,
int32  InCurrentLevel 
)

그룹 정보를 초기화하고 아이템들을 생성

매개변수
InWordType단어 타입 (Animal, Color, Region, Food)
InCurrentLevel현재 선택된 레벨 (이 레벨 이하의 모든 단어를 표시)

ULevelWordGroup.cpp 파일의 15 번째 라인에서 정의되었습니다.

16{
17 WordType = InWordType;
18 CurrentLevel = InCurrentLevel;
19
22}
void UpdateGroupTitle()
그룹 타이틀을 업데이트
int32 CurrentLevel
현재 선택된 레벨
EWordType WordType
현재 그룹의 단어 타입
void PopulateItems()
아이템들을 Uniform Grid Panel에 배치

다음을 참조함 : CurrentLevel, PopulateItems(), UpdateGroupTitle(), WordType.

다음에 의해서 참조됨 : ULevelSelectItem::CreateAnimalGroup(), ULevelSelectItem::CreateColorGroup(), ULevelSelectItem::CreateFoodGroup(), ULevelSelectItem::CreateRegionGroup().

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ PopulateItems()

void ULevelWordGroup::PopulateItems ( )
protected

아이템들을 Uniform Grid Panel에 배치

ULevelWordGroup.cpp 파일의 57 번째 라인에서 정의되었습니다.

58{
60 {
61 return;
62 }
63
64 UGameDataManager* GameDataManager = UGameDataManager::Get(GetWorld());
65 if (!GameDataManager)
66 {
67 return;
68 }
69
70 // 기존 아이템들 제거
71 UniformGridPanel->ClearChildren();
72
73 // 레벨별 단어 데이터를 수집하는 구조체
74 struct FWordItemData
75 {
76 int32 WordCode;
77 int32 Level;
78 bool bIsCurrentLevel;
79 };
80
81 TArray<FWordItemData> AllWordData;
82
83 // WordType에 따라 현재 레벨 이하의 모든 데이터 수집
85 {
86 // FReadData에서 CurrentLevel 이하의 모든 데이터 가져오기
87 for (int32 Level = 1; Level <= CurrentLevel; ++Level)
88 {
89 TArray<FReadData> ReadDataArray = GameDataManager->GetReadDataByLevel(Level);
90 for (const FReadData& ReadData : ReadDataArray)
91 {
92 FWordItemData ItemData;
93 ItemData.WordCode = ReadData.Index;
94 ItemData.Level = Level;
95 ItemData.bIsCurrentLevel = (Level == CurrentLevel);
96 AllWordData.Add(ItemData);
97 }
98 }
99 }
100 else if (WordType == EWordType::Color)
101 {
102 // FColorData에서 CurrentLevel 이하의 모든 데이터 가져오기
103 for (int32 Level = 1; Level <= CurrentLevel; ++Level)
104 {
105 TArray<FColorData> ColorDataArray = GameDataManager->GetColorDataByLevel(Level);
106 for (const FColorData& ColorData : ColorDataArray)
107 {
108 FWordItemData ItemData;
109 ItemData.WordCode = ColorData.Index;
110 ItemData.Level = Level;
111 ItemData.bIsCurrentLevel = (Level == CurrentLevel);
112 AllWordData.Add(ItemData);
113 }
114 }
115 }
116 else if (WordType == EWordType::Region)
117 {
118 // FListenData (Category="Region")에서 CurrentLevel 이하의 모든 데이터 가져오기
119 TArray<FListenData> ListenDataArray = GameDataManager->GetListenDataByCategory(TEXT("Region"));
120 for (const FListenData& ListenData : ListenDataArray)
121 {
122 if (ListenData.Level >= 1 && ListenData.Level <= CurrentLevel)
123 {
124 FWordItemData ItemData;
125 ItemData.WordCode = ListenData.Index;
126 ItemData.Level = ListenData.Level;
127 ItemData.bIsCurrentLevel = (ListenData.Level == CurrentLevel);
128 AllWordData.Add(ItemData);
129 }
130 }
131 }
132 else if (WordType == EWordType::Food)
133 {
134 // FListenData (Category="Food")에서 CurrentLevel 이하의 모든 데이터 가져오기
135 TArray<FListenData> ListenDataArray = GameDataManager->GetListenDataByCategory(TEXT("Food"));
136 for (const FListenData& ListenData : ListenDataArray)
137 {
138 if (ListenData.Level >= 1 && ListenData.Level <= CurrentLevel)
139 {
140 FWordItemData ItemData;
141 ItemData.WordCode = ListenData.Index;
142 ItemData.Level = ListenData.Level;
143 ItemData.bIsCurrentLevel = (ListenData.Level == CurrentLevel);
144 AllWordData.Add(ItemData);
145 }
146 }
147 }
148
149 // Level 내림차순으로 정렬 (3 -> 2 -> 1)
150 AllWordData.Sort([](const FWordItemData& A, const FWordItemData& B)
151 {
152 return A.Level > B.Level;
153 });
154
155 // 아이템 생성 및 배치
156 for (int32 i = 0; i < AllWordData.Num(); ++i)
157 {
158 const FWordItemData& ItemData = AllWordData[i];
159
160 // ULevelWordItem 생성
161 ULevelWordItem* WordItem = CreateWidget<ULevelWordItem>(this, LevelWordItemClass);
162 if (!WordItem)
163 {
164 continue;
165 }
166
167 // 아이템 초기화
168 WordItem->InitInfo(WordType, ItemData.WordCode);
169
170 // 색상 설정 (현재 레벨: 녹색, 하위 레벨: 회색)
171 WordItem->SetItemColor(ItemData.bIsCurrentLevel);
172
173 // 그리드 위치 계산
174 int32 Row = i / ColumnCount;
175 int32 Column = i % ColumnCount;
176
177 // UniformGridPanel에 추가
178 UUniformGridSlot* GridSlot = UniformGridPanel->AddChildToUniformGrid(WordItem, Row, Column);
179 if (GridSlot)
180 {
181 GridSlot->SetHorizontalAlignment(HAlign_Fill);
182 GridSlot->SetVerticalAlignment(VAlign_Fill);
183 }
184 }
185}
데이터 테이블(.csv)에서 게임 데이터를 로드하고 캐시하여 런타임에 빠르게 접근할 수 있도록 제공하는 데이터 관리 서브시스템입니다.
TArray< FListenData > GetListenDataByCategory(const FString &Category) const
TArray< FColorData > GetColorDataByLevel(int32 Level) const
TArray< FReadData > GetReadDataByLevel(int32 Level) const
int32 ColumnCount
그리드 열 개수 (기본값: 2)
TSubclassOf< class ULevelWordItem > LevelWordItemClass
생성할 아이템 위젯 클래스
TObjectPtr< class UUniformGridPanel > UniformGridPanel
아이템들이 배치될 Uniform Grid Panel
void InitInfo(EWordType WordType, int32 WordCode)
void SetItemColor(bool bIsCurrentLevel)
아이템의 색상을 설정 (현재 레벨: 녹색, 하위 레벨: 회색)
색상 데이터를 정의하는 구조체
Definition FColorData.h:19
듣기 학습 데이터를 정의하는 구조체
Definition FListenData.h:19
읽기 학습 데이터를 정의하는 구조체
Definition FReadData.h:19

다음을 참조함 : Animal, Color, ColumnCount, CurrentLevel, Food, UGameDataManager::GetColorDataByLevel(), UGameDataManager::GetListenDataByCategory(), UGameDataManager::GetReadDataByLevel(), ULevelWordItem::InitInfo(), LevelWordItemClass, Region, ULevelWordItem::SetItemColor(), UniformGridPanel, WordType.

다음에 의해서 참조됨 : InitGroup(), SetColumnCount().

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ SetColumnCount()

void ULevelWordGroup::SetColumnCount ( int32  InColumnCount)

그리드에 표시할 열의 개수를 설정

매개변수
InColumnCount열 개수

ULevelWordGroup.cpp 파일의 24 번째 라인에서 정의되었습니다.

25{
26 if (InColumnCount > 0)
27 {
28 ColumnCount = InColumnCount;
29
30 // 열 개수가 변경되면 아이템을 다시 배치
32 }
33}

다음을 참조함 : ColumnCount, PopulateItems().

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ UpdateGroupTitle()

void ULevelWordGroup::UpdateGroupTitle ( )
protected

그룹 타이틀을 업데이트

ULevelWordGroup.cpp 파일의 35 번째 라인에서 정의되었습니다.

36{
37 if (!Text_GroupName)
38 {
39 return;
40 }
41
42 FString GroupName;
43 switch (WordType)
44 {
45 case EWordType::Animal: GroupName = TEXT("Animal"); break;
46 case EWordType::Color: GroupName = TEXT("Color"); break;
47 case EWordType::Region: GroupName = TEXT("Region"); break;
48 case EWordType::Food: GroupName = TEXT("Food"); break;
49 default:
50 GroupName = TEXT("Unknown");
51 break;
52 }
53
54 Text_GroupName->SetText(FText::FromString(GroupName));
55}
TObjectPtr< class UTextBlock > Text_GroupName
그룹 이름 텍스트

다음을 참조함 : Animal, Color, Food, Region, Text_GroupName, WordType.

다음에 의해서 참조됨 : InitGroup().

+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ ColumnCount

int32 ULevelWordGroup::ColumnCount = 2
protected

그리드 열 개수 (기본값: 2)

ULevelWordGroup.h 파일의 68 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : PopulateItems(), SetColumnCount().

◆ CurrentLevel

int32 ULevelWordGroup::CurrentLevel = 1
protected

현재 선택된 레벨

ULevelWordGroup.h 파일의 64 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : InitGroup(), PopulateItems().

◆ Image_Symbol

TObjectPtr<class UImage> ULevelWordGroup::Image_Symbol

그룹 심볼 이미지

ULevelWordGroup.h 파일의 47 번째 라인에서 정의되었습니다.

◆ LevelWordItemClass

TSubclassOf<class ULevelWordItem> ULevelWordGroup::LevelWordItemClass
protected

생성할 아이템 위젯 클래스

ULevelWordGroup.h 파일의 72 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : PopulateItems().

◆ Text_GroupName

TObjectPtr<class UTextBlock> ULevelWordGroup::Text_GroupName

그룹 이름 텍스트

ULevelWordGroup.h 파일의 51 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : UpdateGroupTitle().

◆ UniformGridPanel

TObjectPtr<class UUniformGridPanel> ULevelWordGroup::UniformGridPanel

아이템들이 배치될 Uniform Grid Panel

ULevelWordGroup.h 파일의 55 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : PopulateItems().

◆ WordType

EWordType ULevelWordGroup::WordType
protected

현재 그룹의 단어 타입

ULevelWordGroup.h 파일의 60 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : InitGroup(), PopulateItems(), UpdateGroupTitle().


이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: