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

#include <ALingoGameMode.h>

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

Public 멤버 함수

 ALingoGameMode ()
 
void BeginListenQuest (const FResponseListenScenario &InResponseData)
 
void BeginReadQuest (const FResponseReadScenario &InResponseData)
 
void HandleLuggageSelection (class APlayerState *Player, class Aluggage *luggage)
 

Private 멤버 함수

void HandleCorrectAnswer (class ALingoPlayerState *Player)
 정답 처리
 
void HandleWrongAnswer (class ALingoPlayerState *Player, bool bSymbolCorrect, bool bColorCorrect)
 오답 처리
 
void UpdateQuestRole ()
 
bool ValidateAnswer (class ALingoPlayerState *Player, class Aluggage *Luggage)
 정답을 판정합니다
 

상세한 설명

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

생성자 & 소멸자 문서화

◆ ALingoGameMode()

ALingoGameMode::ALingoGameMode ( )

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

19{
20 // GameState와 PlayerState 클래스 설정
21 GameStateClass = ALingoGameState::StaticClass();
22 PlayerStateClass = ALingoPlayerState::StaticClass();
23
24 // Tick 비활성화 (Timer 기반으로 동작)
25 PrimaryActorTick.bCanEverTick = false;
26}

멤버 함수 문서화

◆ BeginListenQuest()

void ALingoGameMode::BeginListenQuest ( const FResponseListenScenario InResponseData)

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

61{
62 if (!HasAuthority())
63 return;
64
65 // UpdateQuestRole();
66
67 if (auto GS = GetGameState<ALingoGameState>())
68 {
69 GS->SetListenScenarioData(InResponseData);
70
71 GS->SetAllCompassVisibility(false);
72 GS->SetCompassVisibilityByTag("ListenQuest", true);
73 }
74}

◆ BeginReadQuest()

void ALingoGameMode::BeginReadQuest ( const FResponseReadScenario InResponseData)

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

45{
46 if (!HasAuthority())
47 return;
48
50
51 if (auto GS = GetGameState<ALingoGameState>())
52 {
53 GS->SetReadScenarioData(InResponseData);
54
55 GS->SetAllCompassVisibility(false);
56 GS->SetCompassVisibilityByTag("ReadQuest", true);
57 }
58}

다음을 참조함 : UpdateQuestRole().

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

◆ HandleCorrectAnswer()

void ALingoGameMode::HandleCorrectAnswer ( class ALingoPlayerState Player)
private

정답 처리

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

119{
120 if (!HasAuthority() )
121 return;
122
123 if (!Player)
124 return;
125
126 ALingoGameState* LingoGameState = GetGameState<ALingoGameState>();
127 if (!LingoGameState)
128 return;
129
130 // 타이머 중지
131 LingoGameState->StopMissionTimer();
132}
void StopMissionTimer()
미션 타이머를 중지합니다

다음을 참조함 : ALingoGameState::StopMissionTimer().

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

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

◆ HandleLuggageSelection()

void ALingoGameMode::HandleLuggageSelection ( class APlayerState *  Player,
class Aluggage luggage 
)

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

77{
78 if (!HasAuthority())
79 return;
80
81 if (!Player || !luggage)
82 return;
83
84 ALingoPlayerState* LingoPlayerState = Cast<ALingoPlayerState>(Player);
85 if (!LingoPlayerState)
86 return;
87
88 // 정답 판정
89 if ( ValidateAnswer(LingoPlayerState, luggage) )
90 {
91 HandleCorrectAnswer(LingoPlayerState);
92 }
93 else
94 {
95 // 틀린 항목 확인
96 bool bSymbolCorrect = (LingoPlayerState->SelectedWord1 == luggage->Target1);
97 bool bColorCorrect = (LingoPlayerState->SelectedWord2 == luggage->Target2);
98
99 HandleWrongAnswer(LingoPlayerState, bSymbolCorrect, bColorCorrect);
100 }
101}
void HandleCorrectAnswer(class ALingoPlayerState *Player)
정답 처리
void HandleWrongAnswer(class ALingoPlayerState *Player, bool bSymbolCorrect, bool bColorCorrect)
오답 처리
bool ValidateAnswer(class ALingoPlayerState *Player, class Aluggage *Luggage)
정답을 판정합니다
FString SelectedWord2
선택한 색상 (문제2 답변)
FString SelectedWord1
선택한 심볼 (문제1 답변)

다음을 참조함 : HandleCorrectAnswer(), HandleWrongAnswer(), ALingoPlayerState::SelectedWord1, ALingoPlayerState::SelectedWord2, Aluggage::Target1, Aluggage::Target2, ValidateAnswer().

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

◆ HandleWrongAnswer()

void ALingoGameMode::HandleWrongAnswer ( class ALingoPlayerState Player,
bool  bSymbolCorrect,
bool  bColorCorrect 
)
private

오답 처리

매개변수
bSymbolCorrect[in] 심볼이 맞는지 여부
bColorCorrect[in] 색상이 맞는지 여부

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

135{
136 if (!HasAuthority())
137 return;
138
139 if (!Player)
140 return;
141
142 ALingoGameState* LingoGameState = GetGameState<ALingoGameState>();
143 if (!LingoGameState)
144 return;
145
146 // 타이머 패널티
147 constexpr float Penalty = 30.f;
148 LingoGameState->DecreaseMissionTimer(Penalty);
149
150 // 틀린 항목 판정
151 if (!bSymbolCorrect)
152 {
153 Player->SelectedWord1 = TEXT("");
154 Player->bWrongWord1 = true;
155 PRINTLOG(TEXT("[GameMode] Symbol was wrong - Cleared selection"));
156 }
157
158 if (!bColorCorrect)
159 {
160 Player->SelectedWord2 = TEXT("");
161 Player->bWrongWord2 = true;
162 PRINTLOG(TEXT("[GameMode] Color was wrong - Cleared selection"));
163 }
164
165 // 시도 횟수 증가
166 Player->AttemptCount++;
167
168 PRINTLOG(TEXT("[GameMode] HandleWrongAnswer - Attempt count: %d"), Player->AttemptCount);
169}
#define PRINTLOG(fmt,...)
Definition GameLogging.h:30
void DecreaseMissionTimer(const float InValue)

다음을 참조함 : ALingoPlayerState::AttemptCount, ALingoPlayerState::bWrongWord1, ALingoPlayerState::bWrongWord2, ALingoGameState::DecreaseMissionTimer(), PRINTLOG, ALingoPlayerState::SelectedWord1, ALingoPlayerState::SelectedWord2.

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

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

◆ UpdateQuestRole()

void ALingoGameMode::UpdateQuestRole ( )
private

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

29{
30 auto PSList = ULingoGameHelper::GetLingoPlayerStateList(GetWorld());
31 const int32 PlayerCount = PSList.Num();
32
33 if (PlayerCount == 1)
34 {
35 PSList[0]->QuestRole = EQuestRole::Both;
36 }
37 else if (PlayerCount >= 2)
38 {
39 PSList[0]->QuestRole = EQuestRole::OnlyQuestion1;
40 PSList[1]->QuestRole = EQuestRole::OnlyQuestion2;
41 }
42}
static TArray< class ALingoPlayerState * > GetLingoPlayerStateList(const UObject *WorldContextObject)

다음을 참조함 : ULingoGameHelper::GetLingoPlayerStateList().

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

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

◆ ValidateAnswer()

bool ALingoGameMode::ValidateAnswer ( class ALingoPlayerState Player,
class Aluggage Luggage 
)
private

정답을 판정합니다

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

104{
105 if (!Player || !Luggage)
106 return false;
107
108 const bool bSymbolCorrect = (Player->SelectedWord1 == Luggage->Target1);
109 const bool bColorCorrect = (Player->SelectedWord2 == Luggage->Target2);
110
111 PRINTLOG(TEXT("[GameMode] ValidateAnswer - Symbol: %s vs %s (%s), Color: %s vs %s (%s)"),
112 *Player->SelectedWord1, *Luggage->Target1, bSymbolCorrect ? TEXT("Correct") : TEXT("Wrong"),
113 *Player->SelectedWord2, *Luggage->Target2, bColorCorrect ? TEXT("Correct") : TEXT("Wrong"));
114
115 return bSymbolCorrect && bColorCorrect;
116}

다음을 참조함 : PRINTLOG, ALingoPlayerState::SelectedWord1, ALingoPlayerState::SelectedWord2, Aluggage::Target1, Aluggage::Target2.

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

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

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