Files
wnmj/Classes/Games/WNMJ/WN_GameOver.h
2026-02-13 14:34:15 +08:00

117 lines
2.4 KiB
C++

#pragma once
#include <stdio.h>
#include <vector>
#include <string>
#include "cocos2d.h"
#include "ui/CocosGUI.h"
#include "WN_CMD_Sparrow.h"
#include "WN_GameLogic.h"
#include "WN_CardManager.h"
USING_NS_CC;
using namespace ui;
namespace WNMJ_SPACE{
#define HU_TYPE_APPEND(STR)\
if (STR.length() > 0)\
{\
if (strHuType.length() > 0)\
{\
strHuType += "/";\
strHuType += STR;\
}\
else\
{\
strHuType = STR;\
}\
}\
/************************************************************************/
/* 注:该文件使用的是服务器位置,而不是视图位置 */
/************************************************************************/
// 结算节点
class WN_OverNode
{
public:
WN_OverNode();
~WN_OverNode();
// 设置根节点
void SetRootNode(ImageView* pNode){ m_pRootNode = pNode; }
// 初始结算节点
void Init(WORD wChairID);
// 重新初始
void ReSet();
// 显示
void ShowInfo(tagClientScoreInfo &ScoreInfo);
// 获取坐标
Point getPosition();
private:
ImageView* m_pRootNode; // 跟节点
WORD m_wChairID; // 对应椅子号
Sprite* m_spriteBanker; // 庄家标识
Sprite* m_ResultType; // 输赢类型
Text* m_txtUserName;
Text* m_txtResultType;
Text* m_txtScore;
Layout* m_PanelCard;
Sprite* m_Master; // 房主
Sprite* m_big_winner; // 大赢家
};
class WN_GameOver: public cocos2d::Node
{
public:
WN_GameOver();
~WN_GameOver();
CREATE_FUNC(WN_GameOver);
virtual bool init(); // 场景初始化
virtual void onEnter();
virtual void onEnterTransitionDidFinish();
virtual void onExit();
// 函数
public:
void ShowGameResult(bool isGameRecord = false);
void SetGameResultData(WORD wChairID, tagClientScoreInfo &ScoreInfo, bool isSelfData);
void ResetDlg();
void ShowPlayerInfo(WORD wChairID); // 显示指定玩家详细信息
void SetShowPrivate(); // 按钮控制
// 控件
public:
Layout* m_pRootLayout; // 根节点
Button* m_btnStart; // 继续游戏
Button* m_btnShow; // 分享
Button* m_btnPrivate; // 结算信息
Sprite* m_over_player;
WN_OverNode m_OverNode[GAME_PLAYER]; // 玩家结束信息
Sprite* m_Title; // 抬头
WORD m_wSelfChairID; // 自己座位号
tagClientScoreInfo m_ClientScoreInfoEx[GAME_PLAYER];// 结束信息
bool m_bActiveStatus[GAME_PLAYER];
WORD m_wShowChairID; // 当前显示玩家
};
}