127 lines
3.2 KiB
C++
127 lines
3.2 KiB
C++
#include "StdAfx.h"
|
|
|
|
#ifdef _NA_003027_20111013_HONOR_SYSTEM
|
|
|
|
#include ".\TitleListParser.h"
|
|
|
|
TitleListParser::TitleListParser(void)
|
|
{
|
|
}
|
|
|
|
TitleListParser::~TitleListParser(void)
|
|
{
|
|
}
|
|
|
|
VOID TitleListParser::Init()
|
|
{
|
|
title_info_table_.Initialize(50);
|
|
}
|
|
|
|
VOID TitleListParser::Init(char* pack_filename)
|
|
{
|
|
SetPackFileName(pack_filename);
|
|
Init();
|
|
}
|
|
|
|
VOID TitleListParser::Release()
|
|
{
|
|
title_info_table_.SetFirst();
|
|
TitleInfo* title_info = title_info_table_.GetNext();
|
|
while (title_info != NULL)
|
|
{
|
|
delete title_info;
|
|
title_info = title_info_table_.GetNext();
|
|
}
|
|
title_info_table_.clear();
|
|
}
|
|
|
|
BOOL TitleListParser::_Load(BOOL is_reload)
|
|
{
|
|
__UNUSED(is_reload);//
|
|
|
|
int row_size = GetRowSize();
|
|
|
|
for (int row_index = 0; row_index< row_size; ++row_index)
|
|
{
|
|
// 명성코드
|
|
WORD title_code = GetDataWORD("TitleCode", row_index);
|
|
|
|
TitleInfo* title_info = title_info_table_.GetData(title_code);
|
|
if (title_info != NULL)
|
|
{
|
|
// 중복 코드 체크
|
|
SUNLOG(eCRITICAL_LOG, "Duplicate TitleList TitleCode(%d)", title_code);
|
|
continue;
|
|
}
|
|
|
|
//
|
|
title_info = new TitleInfo;
|
|
title_info_table_.Add(title_info, title_code);
|
|
|
|
// 칭호코드
|
|
title_info->title_code = title_code;
|
|
|
|
#ifndef _SERVER //if'N'def
|
|
// 칭호 제목
|
|
title_info->title_name_code = GetDataDWORD("TitleNameCode", row_index);
|
|
// 칭호 표시 타입
|
|
title_info->title_display_type = GetDataBYTE("TitlePos", row_index);
|
|
#endif //_SERVER
|
|
}
|
|
|
|
//랭킹칭호 등록, 나중에 스크립트로 처리
|
|
#ifdef _NA_008679_20160202_REWORK_BATTLEGROUND
|
|
ranking_title_list_.push_back((WORD)HardCode::TITLE_WINCOUNT_GRADE1);
|
|
ranking_title_list_.push_back((WORD)HardCode::TITLE_WINCOUNT_GRADE2);
|
|
ranking_title_list_.push_back((WORD)HardCode::TITLE_WINCOUNT_GRADE3);
|
|
ranking_title_list_.push_back((WORD)HardCode::TITLE_WINCOUNT_GRADE4);
|
|
ranking_title_list_.push_back((WORD)HardCode::TITLE_KILLCOUNT_GRADE1);
|
|
#endif //_NA_008679_20160202_REWORK_BATTLEGROUND
|
|
return TRUE;
|
|
}
|
|
|
|
BOOL TitleListParser::LoadScript(eSCRIPT_CODE script_code, BOOL is_reload)
|
|
{
|
|
switch (script_code)
|
|
{
|
|
case SCRIPT_TITLE_LIST:
|
|
return _Load(is_reload);
|
|
}
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
TitleListParser::TitleInfo* TitleListParser::GetTitleInfo(WORD title_code)
|
|
{
|
|
TitleInfo* title_info = title_info_table_.GetData(title_code);
|
|
|
|
#ifdef _NA_008679_20160202_REWORK_BATTLEGROUND
|
|
if (title_info != NULL)
|
|
{
|
|
if (IsRankingTitle(title_code) == TRUE)
|
|
{
|
|
// 랭킹칭호
|
|
title_info->title_type = eTITLE_TYPE_RANKING;
|
|
}
|
|
else
|
|
{
|
|
title_info->title_type = eTITLE_TYPE_NORMAL;
|
|
}
|
|
}
|
|
|
|
#endif //_NA_008679_20160202_REWORK_BATTLEGROUND
|
|
return title_info;
|
|
}
|
|
|
|
#ifdef _NA_008679_20160202_REWORK_BATTLEGROUND
|
|
BOOL TitleListParser::IsRankingTitle( WORD index )
|
|
{
|
|
std::vector<WORD>::iterator itr =
|
|
std::find(ranking_title_list_.begin(), ranking_title_list_.end(), index);
|
|
if (itr == ranking_title_list_.end()) {
|
|
return FALSE;
|
|
}
|
|
return TRUE;
|
|
}
|
|
#endif //_NA_008679_20160202_REWORK_BATTLEGROUND
|
|
#endif //_NA_003027_20111013_HONOR_SYSTEM
|