45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#ifndef _ZHAJINHUA_GameLogic_h__
|
|
#define _ZHAJINHUA_GameLogic_h__
|
|
#pragma once
|
|
|
|
#include "ZJH_CMD.h"
|
|
|
|
//游戏逻辑类;
|
|
class CZJHGameLogic
|
|
{
|
|
public:
|
|
//构造函数;
|
|
CZJHGameLogic() { }
|
|
//析构函数;
|
|
virtual ~CZJHGameLogic() { }
|
|
|
|
public:
|
|
//有效判断;
|
|
static bool IsValidCard(const uint8 cbCard);
|
|
//获取数值;
|
|
static uint8 GetCardValue(const uint8 cbCard) { return cbCard&ZJH_MASK_VALUE; }
|
|
//获取花色;
|
|
static uint8 GetCardColor(const uint8 cbCard) { return cbCard&ZJH_MASK_COLOR; }
|
|
//获取花色;
|
|
static uint8 GetCardColorEx(const uint8 cbCard) { return (cbCard&ZJH_MASK_COLOR) >> 4; }
|
|
|
|
public:
|
|
//逻辑数值;
|
|
uint8 GetCardLogicValue(const uint8 cbCardData);
|
|
//排列扑克;
|
|
void SortCardList(uint8 cbCardBuffer[], uint8 cbBufferCount);
|
|
|
|
public:
|
|
//获取类型;
|
|
uint8 GetCardType(const uint8 cbCardData[], const uint8 cbCardCount);
|
|
//对比扑克;
|
|
bool CompareCard(const uint8 cbFirstData[], const uint8 cbNextData[], uint8 cbCardCount);
|
|
|
|
// 获取牌型图片路径;
|
|
static std::string getCardTypeImagePath(uint8 cbCardType);
|
|
// 获取牌型声音路径;
|
|
static std::string getCardTypeSoundPath(uint8 cbGender, uint8 cbCardType);
|
|
};
|
|
|
|
#endif // GameLogic_h__
|