010-SDK框架之LYWSDKPlatform.cpp
来源:互联网 发布:centos 升级glibc 编辑:程序博客网 时间:2024/05/17 03:32
#include "LYWSDKPlatform.h"
static LYWSDKPlatform* _instance = NULL;
LYWSDKPlatform::LYWSDKPlatform():
_allCallBack(NULL)
{
}
LYWSDKPlatform::~LYWSDKPlatform()
{
if (_instance)
}
}
LYWSDKPlatform* LYWSDKPlatform::getInstance()
{
if (_instance == NULL)
{
_instance = new LYWSDKPlatform();
}
return _instance;
}
void LYWSDKPlatform::lywSDKCallBack(const char* callBackJsonMessage)
{
LYWSDKPlatform::getInstance()->_allCallBack(callBackJsonMessage);
}
void LYWSDKPlatform::init(char *jsonParam, LYWSDKCallBack callBack)
{
LYWSDKPlatform::getInstance()->_allCallBack = callBack;
LYWSDKPlatformManager::getInstance()->getProtocol()->initSDK(this, "lywSDKInit", jsonParam);
}
void LYWSDKPlatform::login(char *jsonParam)
{
LYWSDKPlatformManager::getInstance()->getProtocol()->callFunctionWithParam("login", jsonParam);
}
void LYWSDKPlatform::pay(char *jsonParam)
{
LYWSDKPlatformManager::getInstance()->getProtocol()->callFunctionWithParam("pay", jsonParam);
}
void LYWSDKPlatform::loop()
{
LYWSDKPlatformManager::getInstance()->getProtocol()->callFunctionWithParam("loop", NULL);
}
static LYWSDKPlatform* _instance = NULL;
LYWSDKPlatform::LYWSDKPlatform():
_allCallBack(NULL)
{
}
LYWSDKPlatform::~LYWSDKPlatform()
{
if (_instance)
{
free(&_allCallBack);
delete _instance;}
}
LYWSDKPlatform* LYWSDKPlatform::getInstance()
{
if (_instance == NULL)
{
_instance = new LYWSDKPlatform();
}
return _instance;
}
void LYWSDKPlatform::lywSDKCallBack(const char* callBackJsonMessage)
{
LYWSDKPlatform::getInstance()->_allCallBack(callBackJsonMessage);
}
void LYWSDKPlatform::init(char *jsonParam, LYWSDKCallBack callBack)
{
LYWSDKPlatform::getInstance()->_allCallBack = callBack;
if(LYWSDKPlatform::getInstance()->_allCallBack == NULL)
{
return;
}
LYWSDKPlatformManager::getInstance()->getProtocol()->initSDK(this, "lywSDKInit", jsonParam);
}
void LYWSDKPlatform::login(char *jsonParam)
{
LYWSDKPlatformManager::getInstance()->getProtocol()->callFunctionWithParam("login", jsonParam);
}
void LYWSDKPlatform::pay(char *jsonParam)
{
LYWSDKPlatformManager::getInstance()->getProtocol()->callFunctionWithParam("pay", jsonParam);
}
void LYWSDKPlatform::loop()
{
LYWSDKPlatformManager::getInstance()->getProtocol()->callFunctionWithParam("loop", NULL);
}
阅读全文
0 0
- 010-SDK框架之LYWSDKPlatform.cpp
- 009-SDK框架之LYWSDKPlatform.h
- 004-SDK框架之LYWSDKUnity3d.cpp
- 007-SDK框架之LYWSDKInterfaceProtocol.cpp
- directdraw sdk ddutil.cpp
- 001-SDK框架之Unity游戏调用SDK
- SDK编程之理解Window应用程序框架
- Qualcomm AR之Vuforia SDK框架
- 002-SDK框架之CSharp中间件
- 003-SDK框架之LYWSDKUnity3d.h
- 005-SDK框架之LYWSDKCallBackListener.h
- 006-SDK框架之LYWSDKInterfaceProtocol.h
- 008-SDK框架之LYWSDKPlatformManager.h
- 011-SDK框架之LYWSDKProtocolIOS.h
- 012-SDK框架之LYWSDKProtocolIOS.mm
- 013-SDK框架之LYWSDKPlatformManager.mm
- cocos2d-x-3.2之cpp-tests框架,cocos2d
- CPP Unit框架
- 嵌入式软件工程师/linux c程序员 笔试题
- LeetCode-46-Permutations 暴力递归
- 线程安全性
- linux之shell脚本学习
- 球赛排名问题
- 010-SDK框架之LYWSDKPlatform.cpp
- Apple-Clang编译器-arch参数
- centos 6.7安装pycharm
- Dynamic Routing Between Capsules(Hinton)
- 交叉编译器arm-linux-gcc
- 避免rm 的巨大伤害
- 统计学习方法笔记-K近邻(k-NN)
- hdoj 4109--Instrction Arrangement(topsort)
- adb 命令