72 lines
1.8 KiB
C++
72 lines
1.8 KiB
C++
#pragma once
|
|
#include "cocos2d.h"
|
|
#include "PlatformHeader.h"
|
|
#include "Singleton.h"
|
|
#include "TimeNode.h"
|
|
#include "IndividualMission.h"
|
|
|
|
typedef void (cocos2d::Ref::*QYSEL_CallFunc)();
|
|
#define QY_CALLFUNC_SELECTOR(_SELECTOR) static_cast<QYSEL_CallFunc>(&_SELECTOR)
|
|
|
|
struct UserCallInfo
|
|
{
|
|
UserCallInfo()
|
|
:pPoint(0)
|
|
,pFun(NULL)
|
|
{}
|
|
cocos2d::Ref* pPoint;
|
|
QYSEL_CallFunc pFun;
|
|
};
|
|
|
|
class UserInfo
|
|
: public GlobalUserInfoSink
|
|
, public TimeNode
|
|
, public Singleton<UserInfo>
|
|
{
|
|
public:
|
|
UserInfo();
|
|
~UserInfo();
|
|
|
|
public:
|
|
void reqAccountInfo(float fWaiteTime = 0.0f);
|
|
void reqIndividual();
|
|
void on_reqAccountInfo();
|
|
tagGlobalUserData* getUserData();
|
|
//tagUserInsureInfo* GetUserInsureInfo();
|
|
std::string getUserNicName();
|
|
std::string getAccounts();
|
|
SCORE getUserScore();
|
|
SCORE getUserInsure();
|
|
uint32 getUserID();
|
|
uint32 getGameID();
|
|
uint8 getGender();
|
|
void modifyWeiXinInfo(uint8 cbGender, std::string szNickName, std::string szHttp);
|
|
std::string getHeadHttp();
|
|
std::string getUserChannel();
|
|
std::string getUserIP();
|
|
void setPhoneNumber(std::string strNumber);
|
|
std::string getPhoneNumber();
|
|
void setIndividualMissionSink(IIndividualMissionSink* pSink);
|
|
|
|
void setAddress(std::string strAddress){ m_strAddress = strAddress; }
|
|
std::string getAddress() { return m_strAddress; }
|
|
|
|
public:
|
|
void addLoginSucessCB(cocos2d::Ref* pPoint,QYSEL_CallFunc pFun);
|
|
void addUpPlayerInfoCB(cocos2d::Ref* pPoint,QYSEL_CallFunc pFun);
|
|
void delCallByPoint(cocos2d::Ref* pPoint);
|
|
|
|
public:
|
|
virtual void upPlayerInfo();
|
|
virtual void LoginSucess();
|
|
|
|
private:
|
|
std::vector<UserCallInfo> m_kUpPlayerInfoCB;
|
|
std::vector<UserCallInfo> m_kLoginSucessCB;
|
|
IndividualMission m_kIndividualMission;
|
|
|
|
public:
|
|
bool m_IsLogin; // 是否已经登陆;
|
|
bool m_isShake; // 是否震动;
|
|
std::string m_strAddress; // 用户地址
|
|
}; |