Пример #1
0
//排列扑克
void CShowHandCard::SortCard()
{
	if (m_bCardCount>0)
	{
		BYTE bTemp,bLast=m_bCardCount-1;
		BOOL bSorted=TRUE;
		do
		{
			bSorted=TRUE;
			for (BYTE i=0;i<bLast;i++) 
			{
				if (CompareOnlyOne(m_CardArray[i],m_CardArray[i+1])==false)
				{	
					bTemp=m_CardArray[i];
					m_CardArray[i]=m_CardArray[i+1];
					m_CardArray[i+1]=bTemp;
					bSorted=FALSE;
				}	
			}
			bLast--;
		} while(!bSorted);
	}
	
	return;
}
Пример #2
0
//排列扑克
void CCardControl::SortCardData()
{
	if (m_CardDataArray.GetCount()>1)
	{
		//变量定义
		bool bFinished=true;
		BYTE bCardDataTemp=0;
		INT_PTR nLastPos=m_CardDataArray.GetCount()-1;

		//排序操作
		do
		{
			bFinished=true;
			for (INT_PTR i=0;i<nLastPos;i++) 
			{
				if (CompareOnlyOne(m_CardDataArray[i],m_CardDataArray[i+1])==false)
				{	
					bCardDataTemp=m_CardDataArray[i];
					m_CardDataArray[i]=m_CardDataArray[i+1];
					m_CardDataArray[i+1]=bCardDataTemp;
					bFinished=false;
				}	
			}
			nLastPos--;
		} while (bFinished==false);
	}

	return;
}
Пример #3
0
//排列扑克
void CGameLogic::SortCard(BYTE bCardList[], BYTE bCardCount)
{
	bool bSorted=true;
	BYTE bTemp,bLast=bCardCount-1;
	do
	{
		bSorted=true;
		for (BYTE i=0;i<bLast;i++) 
		{
			if (CompareOnlyOne(bCardList[i],bCardList[i+1])==FALSE)
			{	
				bTemp=bCardList[i];
				bCardList[i]=bCardList[i+1];
				bCardList[i+1]=bTemp;
				bSorted=false;
			}	
		}
		bLast--;
	} while (bSorted==false);

	return;
}
Пример #4
0
//对比散牌
bool CGameLogic::CompareSanCard(BYTE bFirstList[], BYTE bLastList[], BYTE bCardCount)
{
	return CompareOnlyOne(bFirstList[0],bLastList[0]);
}
Пример #5
0
//对比三条
bool CGameLogic::CompareSanTiao(BYTE bFirstList[], BYTE bLastList[])
{
	return CompareOnlyOne(bFirstList[2],bLastList[2]);
}
Пример #6
0
//对比顺子
bool CGameLogic::CompareShunZhi(BYTE bFirstList[], BYTE bLastList[])
{
	return CompareOnlyOne(bFirstList[0],bLastList[0]);
}