Example #1
0
void Mano::HacerJugada()
{
	if (!CheckStraighFlush())
	{
		if (!CheckFourOfAKind())
		{
			if (!CheckFullHouse())
			{
				if (!CheckFlush())
				{
					if (!CheckStraight())
					{
						if (!CheckThreeOfAKind())
						{
							if (!CheckTwoPair())
							{
								if (!CheckPair())
								{
									if (!CheckHighCard())
									{
										void;
									}
								}
							}
						}
					}
				}
			}
		}
	}
}
Example #2
0
void ArticleCache::Run()
{
	// automatically flush the cache if it is filled to 90% (only in DirectWrite mode)
	size_t fillThreshold = (size_t)g_Options->GetArticleCache() * 1024 * 1024 / 100 * 90;

	int resetCounter = 0;
	bool justFlushed = false;
	while (!IsStopped() || m_allocated > 0)
	{
		if ((justFlushed || resetCounter >= 1000 || IsStopped() ||
			 (g_Options->GetDirectWrite() && m_allocated >= fillThreshold)) &&
			m_allocated > 0)
		{
			justFlushed = CheckFlush(m_allocated >= fillThreshold);
			resetCounter = 0;
		}
		else if (!m_allocated)
		{
			Guard guard(m_allocMutex);
			m_allocCond.Wait(m_allocMutex, [&]{ return IsStopped() || m_allocated > 0; });
			resetCounter = 0;
		}
		else
		{
			Util::Sleep(5);
			resetCounter += 5;
		}
	}
}
Example #3
0
unsigned int HandRank::GetHandRank(list<Card> cards)
{
	unsigned int HandRank = 0;
	cards.sort();
	cards.reverse();

	if( CheckFlush(cards, HandRank)) return HandRank;
	if( CheckStraight(cards, HandRank)) return HandRank;
	if( CheckThreeOfAKind(cards, HandRank)) return HandRank;
	if( CheckTwoPair(cards, HandRank)) return HandRank;
	if( CheckPair(cards, HandRank) ) return HandRank;

	SetHighCard(cards, HandRank);
	return HandRank;
}
Example #4
0
void FileBuffer::Flush()
{
	CheckFlush(0);
}
Example #5
0
void FileBuffer::Write32(uint32_t data)
{
	fBuffer.Append32(data);
	CheckFlush(fMaxSize);
}
Example #6
0
void FileBuffer::Write16(uint16_t data)
{
	fBuffer.Append16(data);
	CheckFlush(fMaxSize);
}
Example #7
0
void FileBuffer::Write8(uint8_t data)
{
	fBuffer.Append8(data);
	CheckFlush(fMaxSize);
}