Files
Sun1602/ProgramCommon/CashCategoryParser.cpp
T
git 9cb257e7ae Add GameClients drops and keep current 1602 source work.
CN1602 is the local client. KR is the official tree with unpacked Data, System, and Sound. Packed .wpk files stay off git.
2026-08-30 23:24:31 +03:00

62 lines
1.2 KiB
C++

#include "StdAfx.h"
#include ".\CashCategoryParser.h"
#ifdef _NA_0_20101015_SOLAR_SHOP_TEMP_REFACTORING
CashCategoryParser::CashCategoryParser(void)
{
}
CashCategoryParser::~CashCategoryParser(void)
{
}
VOID CashCategoryParser::Init()
{
}
VOID CashCategoryParser::Init( char * pszPackFileName )
{
SetPackFileName( pszPackFileName );
}
VOID CashCategoryParser::Release()
{
}
BOOL CashCategoryParser::_Load( BOOL bReload )
{
__UNUSED(bReload);
const int row_count = GetRowSize();
category_hashmap_.clear();
uint itemcode = 0;
uint category_index = 0;
for (int row = 0 ; row < row_count ; ++row)
{
itemcode = GetDataDWORD("code", row);
category_index = GetDataDWORD("category", row);
if (!category_hashmap_.insert(CategoryHashMap::value_type(itemcode, category_index)).second)
SUNLOG(eCRITICAL_LOG, "[CashCategoryParser] duplicate ItemCode[%d]", itemcode);
category_hashmap_[itemcode] = category_index;
}
return TRUE;
}
BOOL CashCategoryParser::LoadScript( eSCRIPT_CODE scriptCode, BOOL bReload )
{
switch (scriptCode)
{
case SCRIPT_CASHCATEGORY:
return _Load( bReload );
}
return FALSE;
}
#endif //#ifdef _NA_0_20101015_SOLAR_SHOP_TEMP_REFACTORING