61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
#include "stdAfx.h"
|
|
#include "CashShop.h"
|
|
namespace ConvenienceStore
|
|
{
|
|
CashShop* CashShop::static_instance_ = NULL;
|
|
CashShop::CashShop(void):
|
|
shop_list_manager_(NULL)
|
|
{
|
|
if( static_instance_ != NULL )
|
|
{
|
|
return;
|
|
}
|
|
static_instance_ = this;
|
|
}
|
|
|
|
CashShop::~CashShop(void)
|
|
{
|
|
if( shop_list_manager_ != NULL )
|
|
{
|
|
delete shop_list_manager_;
|
|
shop_list_manager_ = NULL;
|
|
}
|
|
}
|
|
ProductItem* CashShop::GetProduct(int Seq)
|
|
{
|
|
return product_list_.GetProduct(Seq);
|
|
}
|
|
bool CashShop::BuildShopList(CConfig * config)
|
|
{
|
|
if( shop_list_manager_ != NULL )
|
|
{
|
|
delete shop_list_manager_;
|
|
}
|
|
CListVersionInfo version_info;
|
|
|
|
version_info.Zone = config->getVersionZone();
|
|
version_info.year = config->getVersionYear();
|
|
version_info.yearId = config->getVersionYearId();
|
|
|
|
shop_list_manager_ = new CShopListManager;
|
|
|
|
shop_list_manager_->SetListManagerInfoVer6(HTTP,
|
|
config->getScriptConnectIP(),
|
|
config->getScriptPortNum(),
|
|
_T(""),
|
|
_T(""),
|
|
config->getScriptPath(),
|
|
_T("./log"), //_T("D:/Perforce/test_Dev_release/2.ÃֽŰ³¹ß¹öÀü/SUN_Client/log"),
|
|
false,
|
|
version_info);
|
|
WZResult res = shop_list_manager_->LoadScriptList(true);
|
|
if( res.IsSuccess() == false )
|
|
{
|
|
return false;
|
|
}
|
|
product_list_.BuildProductList(shop_list_manager_->GetListPtr());
|
|
return true;
|
|
}
|
|
|
|
}
|