Files
wnmj/Classes/Network/ImagicDownManager.h
2026-02-13 14:34:15 +08:00

53 lines
1.1 KiB
C++

#pragma once
#include "cocos2d.h"
#include "Singleton.h"
#include "WebReq.h"
USING_NS_CC;
using namespace cocos2d::network;
struct ImagicDownInfo
{
ImagicDownInfo()
{
fActTime = 0;
pRequest = NULL;
pButtonSprite = NULL;
bSameSize = false;
bCircle = false;
}
Sprite* pSprite;
Menu* pButtonSprite;
HttpRequest* pRequest;
std::string kUrl;
std::string kImagicName;
float fActTime;
bool bSameSize;
bool bCircle;
};
typedef std::vector<ImagicDownInfo> ImagicDownInfoList;
class ImagicDownManager
:public Singleton<ImagicDownManager>
,public Ref
{
public:
ImagicDownManager();
~ImagicDownManager();
public:
void OnImagic();
void GetImagic(HttpClient *sender, HttpResponse *response);
public:
Texture2D* getDownTexture(std::string kFile);
void addDown(Node* pNode, std::string kUrl, int iUserID, bool isWeixinHead = true, bool bSameSize = true, bool bCircle=false);
void addDown(Node* pNode, std::string kUrl, std::string kFileName, bool bSameSize = true, bool bCircle = false);
void upTime(float fTime);
public:
int m_iIdexCout;
ImagicDownInfoList m_pDownList;
std::vector<HttpResponse*> m_pGetList;
};