#include "PlatformInterface.h"
#include "PlatformInterface_IOS.h"

/*******************************************************************************
 * 函数原型：void CPlatformInterface::SetAreaInfo( string areaID, string areaName )
 * 函数功能：设置当前游戏登录选择的区号及区的名字
 *
 * 参数[IN]:	无
 *
 * 返回值：无
 ********************************************************************************/
void CPlatformInterface::SetAreaInfo( string areaID, string areaName )
{
    CPlatformInterface_IOS::SetAreaInfo(areaID.c_str(), areaName.c_str());
}

/*******************************************************************************
 * 函数原型：void CPlatformInterface::SetRoleInfo( string roleName, string roleID )
 * 函数功能：设置当前进入游戏的角色ＩＤ及角色的名字
 *
 * 参数[IN]:	无
 *
 * 返回值：无
 ********************************************************************************/
void CPlatformInterface::SetRoleInfo( string roleName, string roleID, int rolelevel, string Profession, int Power, int Gold)
{
    CPlatformInterface_IOS::SetRoleInfo(roleName.c_str(), roleID.c_str(), rolelevel, Profession.c_str(), Power, Gold);
}

//得到平台的编号值
int CPlatformInterface::GetPlatformID()
{
	return CPlatformInterface_IOS::GetPlatformID();
}

//得到平台的名字，非中文，可以作为安卓的项目目录名
string CPlatformInterface::GetPlatformName()
{
	return CPlatformInterface_IOS::GetPlatformName();
}

//获取发现服返回结果
string CPlatformInterface::getEveData()
{
    return CPlatformInterface_IOS::GetEveData();
}

string CPlatformInterface::getAccessToken()
{
    return CPlatformInterface_IOS::GetAccessToken();
}

//登录接口处理
void CPlatformInterface::Login()
{
    CPlatformInterface_IOS::Login();
}


//充值类型值，及购买的数量
void CPlatformInterface::Pay( string itemid, string itemName, string type, int num, float money, string currency, string extData, string paysdktype)
{
    CPlatformInterface_IOS::Pay(itemid.c_str(), itemName.c_str(), type.c_str(), num , money, currency.c_str(), extData.c_str(), paysdktype.c_str());
}

//由游戏层调用来的退出ＳＤＫ的登录账号的注销操作
void CPlatformInterface::GameToPlatformLogout()
{
    CPlatformInterface_IOS::GameToPlatformLogout();
}

//返回当前支持的支付列表ＪＳＯＮ串
void CPlatformInterface::GetPayList()
{
    CPlatformInterface_IOS::GetPayList();
}

void CPlatformInterface::getOrderList()	//查询未处理订单
{
    CPlatformInterface_IOS::GetOrderList();
}

void CPlatformInterface::getServerList(string whitekey)
{
    CPlatformInterface_IOS::getServerList(whitekey.c_str());
}

void CPlatformInterface::getNoticeList(string type, string serverid)
{
    CPlatformInterface_IOS::getNoticeList(type.c_str(), serverid.c_str());
}

void CPlatformInterface::payFeedback(const string billNo)
{
    CPlatformInterface_IOS::PayFeedback(billNo.c_str());
}

string CPlatformInterface::getClientId()    //获取游戏的clientId
{
    return CPlatformInterface_IOS::GetClientId();
}

string CPlatformInterface::CallFunction(string pluginType, string sdkType, string function, string values)
{
    return CPlatformInterface_IOS::CallFunction(pluginType.c_str(), sdkType.c_str(), function.c_str(), values.c_str());
}

//构造函数处理
CPlatformInterface::CPlatformInterface(void)
{

}

void CPlatformInterface::payCallback(const char *billNo, const char *accessToken)
{
    printf("=====payCallback, current billNO = %s\n", billNo);
}

void CPlatformInterface::PaySuccessCallBack(const char *billNo, const char *extData)
{
    printf("=====PaySuccessCallBack, current billNO = %s\n", billNo);
}

void CPlatformInterface::PayFailCallBack(const char *information)
{
    printf("=====PayFailCallBack, information = %s\n", information);
}

void CPlatformInterface::PayCancelCallBack(const char *information)
{
    printf("=====PayCancelCallBack, information = %s\n", information);
}

void CPlatformInterface::PayClosePayPage(const char *information)
{
    printf("=====PayClosePayPage, information = %s\n", information);
}

void CPlatformInterface::getPayListCallback(const char *payListResult)
{
    printf("=====getPayListCallback, current payListResult = %s\n", payListResult);
}

void CPlatformInterface::getServerListCallback(const char *serverlist)
{
    printf("=====getServerListCallback, current serverlist = %s\n", serverlist);
}

void CPlatformInterface::getNoticeListCallback(const char *noticelist)
{
    printf("=====getNoticeListCallback, current noticelist = %s\n", noticelist);
}

void CPlatformInterface::GameCenterCloseCallback()
{
    printf("=====GameCenterCloseCallback\n");
}

void CPlatformInterface::ShareResult(const char* sharetype, const char* state, const char* result)
{
    printf("=====ShareResult, sharetype:%s,state:%s\n", sharetype, state);
}

void CPlatformInterface::LoginSuccess( const char * username, const char * userID, const char * sessionID, const char * token, const char * datadict )
{
	printf("=====Login Success, current username = %s, userID=%s, token=%s, datadict=%s\n", username, userID, token, datadict);
}

void CPlatformInterface::SwichAccount(const char * username, const char * userID, const char * sessionID, const char * token, const char * datadict)
{
    printf("=====SwichAccount Success, current username = %s, userID=%s, token=%s, datadict=%s\n", username, userID, token, datadict);
}

/**
 *登陆失败回调
 *code值,失败时为0,取消时为1
 */
void CPlatformInterface::LoginCancel(int code)
{
    printf("=====Login Cancel Callback %d=====\n", code);
}

void CPlatformInterface::RegisterCloseCallback()
{
    printf("=====RegisterCloseCallback=====\n");
}

void CPlatformInterface::initSdkCallback()
{
	printf("=====initSdkCallback=====\n");
}

/**
 *sdk通知游戏退出登录
 */
void CPlatformInterface::PlatformToGameLogout()
{
	printf("=====PlatformToGameLogout Callback=====\n");
}
